/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; color: #2c2c2c; background: #f4f6f8; min-height: 100vh; }

/* ── VARIABLES ── */
:root {
    --green:      #3a8c3f;
    --green-dark: #2e7033;
    --green-light:#e8f5e9;
    --blue:       #1976d2;
    --blue-dark:  #1565c0;
    --border:     #c8e6c9;
    --row-border: #e0e0e0;
    --muted:      #666;
    --disabled-bg:#f5f5f5;
    --radius:     6px;
}

/* ── LOGIN PAGE ── */
.login-page { display: flex; flex-direction: column; min-height: 100vh; }
.login-header { background: var(--green); padding: 18px 24px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.login-header .logo { width: 38px; height: 38px; background: rgba(255,255,255,.18); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.login-header h1 { color: #fff; font-size: 16px; font-weight: 700; }
.login-header p { color: rgba(255,255,255,.72); font-size: 12px; margin-top: 1px; }

.login-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.10); width: 100%; max-width: 400px; overflow: hidden; }
.login-card-header { background: var(--green); padding: 26px; text-align: center; }
.login-card-header h2 { color: #fff; font-size: 20px; font-weight: 700; }
.login-card-header p { color: rgba(255,255,255,.75); font-size: 13px; margin-top: 4px; }
.login-card-body { padding: 28px; }

.role-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.role-tab { flex: 1; background: none; border: none; cursor: pointer; padding: 10px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .2s; }
.role-tab.active { color: var(--green); border-bottom-color: var(--green); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.form-group input[type="text"],
.form-group input[type="password"] { width: 100%; padding: 10px 13px; border: 1.5px solid #d0d0d0; border-radius: var(--radius); font-size: 14px; font-family: inherit; color: #2c2c2c; transition: border-color .2s; }
.form-group input:focus { outline: none; border-color: var(--green); }
.btn-login { width: 100%; padding: 12px; background: var(--green); color: #fff; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .2s; }
.btn-login:hover { background: var(--green-dark); }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; border-radius: var(--radius); padding: 10px 13px; font-size: 13px; margin-bottom: 14px; }

/* ── APP HEADER ── */
.app-header { background: var(--green); height: 58px; display: flex; align-items: center; padding: 0 20px; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.hdr-brand { display: flex; align-items: center; gap: 12px; }
.hdr-icon { width: 34px; height: 34px; background: rgba(255,255,255,.18); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.hdr-title { color: #fff; font-size: 15px; font-weight: 700; }
.hdr-sub { color: rgba(255,255,255,.7); font-size: 11px; margin-top: 1px; }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.badge-user { background: rgba(255,255,255,.15); color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-role { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-expert { background: #fff3e0; color: #bf360c; }
.badge-director { background: #e8f5e9; color: #1b5e20; }
.btn-hdr { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); padding: 6px 14px; border-radius: 5px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-hdr:hover { background: rgba(255,255,255,.22); }

/* ── TAB BAR ── */
.tab-bar { background: #fff; border-bottom: 2px solid var(--border); display: flex; overflow-x: auto; padding: 0 14px; position: sticky; top: 58px; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.tab-bar::-webkit-scrollbar { height: 3px; }
.tab-bar::-webkit-scrollbar-thumb { background: var(--border); }
.tab-btn { flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 11px 15px; font-size: 12.5px; font-family: inherit; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: color .2s, border-color .2s; display: flex; align-items: center; gap: 6px; }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-btn:hover { color: var(--green-dark); }
.tab-progress { font-size: 10px; background: #e0e0e0; color: #666; padding: 1px 6px; border-radius: 10px; font-weight: 700; }
.tab-btn.active .tab-progress { background: var(--green-light); color: var(--green-dark); }

/* ── PAGE ── */
.page { max-width: 1400px; margin: 20px auto; padding: 0 12px 100px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── FORM TABLE ── */
.form-table { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.form-table-head { display: grid; grid-template-columns: 70px 200px 1fr 260px 110px 230px; background: var(--green); color: #fff; font-weight: 700; font-size: 12.5px; }
.form-table-head .th { padding: 11px 13px; }
.form-row { display: grid; grid-template-columns: 70px 200px 1fr 260px 110px 230px; border-top: 1px solid var(--row-border); align-items: start; transition: background .2s; }
.form-row:hover { background: #fafffe; }
.form-row.approved { background: #f1fff4; }
.form-row.commented { background: #f0f7ff; }

.cell-num { padding: 15px 0 15px 13px; }
.qnum { font-size: 13px; font-weight: 700; color: #1a1a1a; }
.qcode { font-size: 11px; color: var(--green-dark); background: var(--green-light); padding: 2px 6px; border-radius: 10px; display: inline-block; margin-top: 3px; font-weight: 700; }

.cell-question { padding: 15px 13px; }
.q-label { font-weight: 600; font-size: 13.5px; line-height: 1.5; color: #1a1a1a; }
.q-formula { font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 4px; }

.cell-answer { padding: 13px; }
.cell-evidence { padding: 13px; border-left: 1px solid var(--row-border); }
.cell-status { padding: 13px; border-left: 1px solid var(--row-border); }
.cell-comment { padding: 13px; border-left: 1px solid var(--row-border); }

/* ── CONTROLS ── */
select.ans-select { width: 100%; padding: 7px 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 13px; font-family: inherit; color: #2c2c2c; background: #fff; cursor: pointer; transition: border-color .2s; }
select.ans-select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(58,140,63,.12); }
select.ans-select[disabled] { background: var(--disabled-bg); color: #aaa; cursor: not-allowed; }
select.ans-select[multiple] { min-height: 80px; padding: 4px 6px; }

input.ans-number, input.ans-url { width: 100%; padding: 7px 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 13px; font-family: inherit; color: #2c2c2c; transition: border-color .2s; }
input.ans-number:focus, input.ans-url:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(58,140,63,.12); }
input.ans-number[disabled], input.ans-url[disabled] { background: var(--disabled-bg); color: #aaa; cursor: not-allowed; }

.sub-detail { margin-top: 6px; display: none; }
.sub-detail input { width: 100%; padding: 6px 9px; border: 1px solid #ccc; border-radius: 5px; font-size: 12.5px; font-family: inherit; }

.multi-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── EVIDENCE ── */
.ev-block { display: flex; flex-direction: column; gap: 6px; }
.ev-lbl { font-size: 11px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 2px; }
.ev-input { width: 100%; padding: 6px 9px; border: 1px solid #ccc; border-radius: 5px; font-size: 12px; font-family: inherit; color: #2c2c2c; transition: border-color .2s; }
.ev-input:focus { outline: none; border-color: var(--blue); }
.ev-input[disabled] { background: var(--disabled-bg); color: #aaa; cursor: not-allowed; }

/* ── STATUS ── */
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 700; }
.status-pending  { background: #fff3e0; color: #e65100; }
.status-commented{ background: #e3f2fd; color: #1565c0; }
.status-approved { background: #e8f5e9; color: #1b5e20; }

.btn-approve { width: 100%; margin-top: 7px; padding: 6px; background: var(--green); color: #fff; border: none; border-radius: 5px; font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .2s; }
.btn-approve:hover { background: var(--green-dark); }
.btn-approve:disabled { background: #ccc; cursor: not-allowed; }
.approved-info { font-size: 11px; color: var(--green-dark); margin-top: 4px; }

/* ── COMMENTS ── */
.comment-area { width: 100%; padding: 6px 9px; border: 1px solid #ccc; border-radius: 5px; font-size: 12.5px; font-family: inherit; color: #2c2c2c; resize: vertical; min-height: 52px; transition: border-color .2s; }
.comment-area:focus { outline: none; border-color: var(--blue); }
.comment-area[disabled] { background: var(--disabled-bg); color: #555; cursor: default; }
.btn-comment { width: 100%; margin-top: 5px; padding: 5px; background: var(--blue); color: #fff; border: none; border-radius: 5px; font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .2s; }
.btn-comment:hover { background: var(--blue-dark); }
.btn-comment:disabled { background: #ccc; cursor: not-allowed; }

/* ── MANUAL ANSWER SAVE BUTTON ── */
/* btn-save-answer base rules consolidated below in the detailed section */
.save-answer-note {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
}
.save-answer-note.note-saving { color: #6b7280; }
.save-answer-note.note-saved { color: var(--green-dark); font-weight: 700; }
.save-answer-note.note-error { color: #b91c1c; font-weight: 700; }


/* ── BOTTOM NAV ── */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; z-index: 150; box-shadow: 0 -2px 8px rgba(0,0,0,.07); }
.nav-section { font-size: 13px; color: var(--muted); font-weight: 600; }
.btn-nav { padding: 9px 22px; border: none; border-radius: 5px; font-size: 13px; font-family: inherit; font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: .4px; }
.btn-prev { background: #555; color: #fff; }
.btn-prev:hover { background: #333; }
.btn-prev:disabled { background: #ccc; cursor: not-allowed; }
.btn-next { background: var(--blue); color: #fff; }
.btn-next:hover { background: var(--blue-dark); }
.btn-submit { background: var(--green); color: #fff; }
.btn-submit:hover { background: var(--green-dark); }

/* ── PROGRESS BAR ── */
.progress-wrap { position: fixed; bottom: 52px; left: 0; right: 0; height: 4px; background: #e0e0e0; z-index: 149; }
.progress-fill { height: 100%; background: var(--green); transition: width .4s; }

/* ── TOAST ── */
#toast { position: fixed; bottom: 66px; right: 20px; background: #2c2c2c; color: #fff; padding: 11px 18px; border-radius: 6px; font-size: 13px; z-index: 500; opacity: 0; pointer-events: none; transition: opacity .3s; max-width: 300px; }
#toast.show { opacity: 1; }

/* ── SAVE INDICATOR ── */
.save-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ccc; margin-right: 6px; transition: background .3s; }
.save-dot.saved { background: var(--green); }
.save-dot.saving { background: #ff9800; }

/* ── SUMMARY BANNER ── */
.summary-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.sum-item { display: flex; flex-direction: column; }
.sum-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.sum-val { font-size: 20px; font-weight: 700; color: #1a1a1a; margin-top: 2px; }
.sum-val.green { color: var(--green-dark); }
.sum-val.blue  { color: var(--blue-dark); }
.sum-val.amber { color: #e65100; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
    .form-table-head { grid-template-columns: 60px 160px 1fr 200px 90px 180px; }
    .form-row        { grid-template-columns: 60px 160px 1fr 200px 90px 180px; }
}
@media (max-width: 800px) {
    .form-table-head { grid-template-columns: 50px 1fr 1fr; }
    .form-table-head .th:nth-child(n+4) { display: none; }
    .form-row        { grid-template-columns: 50px 1fr 1fr; }
    .form-row > .cell-evidence,
    .form-row > .cell-status,
    .form-row > .cell-comment { display: none; }
}

/* ── Evidence actions update ── */
.ev-required { font-size: 12px; font-weight: 700; color: #1b5e20; margin-bottom: 4px; }
.ev-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.btn-mini { padding: 6px 10px; background: var(--blue); color: #fff; border: none; border-radius: 5px; font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .2s; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.btn-mini:hover { background: var(--blue-dark); }
.btn-mini:disabled { background: #ccc; cursor: not-allowed; }
.btn-upload { background: var(--green); }
.btn-upload:hover { background: var(--green-dark); }
.btn-download { background: #555; }
.btn-download:hover { background: #333; }
.ev-file { display: none; }
.ev-file-status { font-size: 11px; color: var(--muted); margin-top: 5px; min-height: 14px; }

/* ── Horizontal director comment update ── */
.comment-inline { display: flex; gap: 8px; align-items: stretch; width: 100%; }
.comment-inline .comment-area { flex: 1 1 auto; min-width: 220px; min-height: 42px; height: 42px; resize: horizontal; }
.comment-inline .btn-comment { width: 92px; margin-top: 0; padding: 6px 10px; flex: 0 0 92px; }

/* Give evidence/comment cells enough horizontal space */
.form-table-head { grid-template-columns: 70px 210px minmax(280px,1fr) minmax(330px,.95fr) 120px minmax(360px,.9fr); }
.form-row { grid-template-columns: 70px 210px minmax(280px,1fr) minmax(330px,.95fr) 120px minmax(360px,.9fr); }
.form-table { overflow-x: auto; }
.form-table-head, .form-row { min-width: 1370px; }


/* FINAL EVIDENCE BUTTON FIX */
.ev-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    margin-top: 8px !important;
}
.btn-mini,
.btn-choose,
.btn-go,
.btn-download {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 32px !important;
    padding: 7px 12px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: var(--blue) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}
.btn-mini:hover,
.btn-choose:hover,
.btn-go:hover,
.btn-download:hover { background: var(--blue-dark) !important; }
.ev-file { display: none !important; visibility: hidden !important; width: 0 !important; height: 0 !important; opacity: 0 !important; position: absolute !important; pointer-events: none !important; }
.ev-file-status { display:block; font-size: 11px; color: var(--green-dark); margin-top: 6px; min-height: 14px; }
.comment-inline { display: flex !important; flex-direction: row !important; gap: 8px !important; align-items: stretch !important; width: 100% !important; }
.comment-inline .comment-area { flex: 1 1 auto !important; min-width: 170px !important; min-height: 42px !important; height: 42px !important; resize: horizontal !important; }
.comment-inline .btn-comment { width: 92px !important; margin-top: 0 !important; flex: 0 0 92px !important; }


/* ── Layout update: evidence under question ── */
.form-table-head { grid-template-columns: 70px minmax(360px, 1.4fr) minmax(260px, .9fr) 120px 260px !important; }
.form-row { grid-template-columns: 70px minmax(360px, 1.4fr) minmax(260px, .9fr) 120px 260px !important; }
.cell-evidence { display:none !important; }
.ev-under-question { margin-top: 10px; padding: 10px; background: #f7fff8; border: 1px solid var(--border); border-radius: var(--radius); }
.ev-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.ev-actions .btn-mini { margin:0; }
.comment-inline { display:flex; gap:8px; align-items:stretch; }
.comment-inline .comment-area { min-height:44px; flex:1; }
.comment-inline .btn-comment { width:auto; min-width:88px; margin-top:0; }

/* ── Evidence list + result tabs ── */
.list-header { display:flex; justify-content:space-between; align-items:center; gap:16px; background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; margin-bottom:14px; }
.list-header h2 { font-size:18px; color:#1a1a1a; }
.list-header p { font-size:13px; color:var(--muted); margin-top:4px; }
.btn-list-download { background:var(--green) !important; color:#fff !important; border-color:var(--green) !important; }
.result-cards { display:grid; grid-template-columns:repeat(4, minmax(160px,1fr)); gap:12px; margin-bottom:14px; }
.result-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:16px; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.result-card span { display:block; font-size:11px; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
.result-card strong { display:block; font-size:24px; color:var(--green-dark); margin-top:6px; }
.result-table-wrap { background:#fff; border:1px solid var(--border); border-radius:var(--radius); overflow:auto; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.result-table { width:100%; border-collapse:collapse; font-size:13px; min-width:900px; }
.result-table th { background:var(--green); color:#fff; text-align:left; padding:10px; white-space:nowrap; }
.result-table td { border-top:1px solid var(--row-border); padding:9px 10px; vertical-align:top; }
.result-table tbody tr:hover { background:#fafffe; }
.result-actions { white-space:nowrap; }
@media (max-width: 900px) {
  .form-table-head { display:none; }
  .form-row { display:block !important; padding:12px; }
  .cell-num,.cell-question,.cell-answer,.cell-status,.cell-comment { border:0 !important; padding:8px 0 !important; }
  .result-cards { grid-template-columns:repeat(2, 1fr); }
  .list-header { align-items:flex-start; flex-direction:column; }
}


/* STATIC EVIDENCE + COMMENT FIX v2 */
.form-table-head { grid-template-columns: 70px minmax(440px, 1.35fr) minmax(300px, .85fr) 125px minmax(420px, .9fr) !important; }
.form-row { grid-template-columns: 70px minmax(440px, 1.35fr) minmax(300px, .85fr) 125px minmax(420px, .9fr) !important; }
.form-table-head, .form-row { min-width: 1580px !important; }
.cell-comment { overflow: visible !important; }
.comment-inline { display: grid !important; grid-template-columns: minmax(250px, 1fr) 110px !important; gap: 8px !important; align-items: stretch !important; width: 100% !important; }
.comment-inline .comment-area { min-width: 0 !important; width: 100% !important; height: 54px !important; min-height: 54px !important; resize: vertical !important; overflow: auto !important; }
.comment-inline .btn-comment { width: 110px !important; min-width: 110px !important; height: 54px !important; margin-top: 0 !important; flex: none !important; white-space: normal !important; }
.ev-static-name { background: #fff; border: 1px solid #c8e6c9; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }
.ev-static-label { display: block; font-size: 10.5px; font-weight: 800; color: #2e7033; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 3px; }
.ev-static-name strong { display: block; font-size: 12.5px; color: #1a1a1a; line-height: 1.35; }
.ev-static-name small { display: block; font-size: 11.5px; color: #666; margin-top: 3px; direction: rtl; text-align: left; }
.evidence-template-table th:nth-child(3), .evidence-template-table td:nth-child(3) { min-width: 280px; }
.evidence-template-table th:nth-child(4), .evidence-template-table td:nth-child(4) { min-width: 240px; }
.evidence-template-table th:nth-child(9), .evidence-template-table td:nth-child(9) { min-width: 150px; }
.result-table-wrap { overflow-x: auto; }
.result-table { min-width: 1100px; }
@media (max-width: 800px) {
  .form-table-head, .form-row { min-width: 1000px !important; grid-template-columns: 50px minmax(330px, 1fr) minmax(240px, .8fr) 110px minmax(260px,.8fr) !important; }
  .form-table-head .th:nth-child(n+4) { display: block !important; }
  .form-row > .cell-status, .form-row > .cell-comment { display: block !important; }
}

/* FINAL FIX: Director comment column must not be clipped */
.form-table {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
.form-table-head,
.form-row {
    grid-template-columns: 70px minmax(440px, 1.25fr) minmax(300px, .85fr) 125px minmax(560px, 1.1fr) !important;
    min-width: 1700px !important;
}
.cell-comment {
    overflow: visible !important;
    min-width: 0 !important;
}
.comment-inline {
    display: grid !important;
    grid-template-columns: minmax(360px, 1fr) 125px !important;
    gap: 10px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: none !important;
}
.comment-inline .comment-area {
    width: 100% !important;
    min-width: 0 !important;
    height: 58px !important;
    min-height: 58px !important;
    resize: vertical !important;
    overflow: auto !important;
    display: block !important;
}
.comment-inline .btn-comment {
    width: 125px !important;
    min-width: 125px !important;
    height: 58px !important;
    margin-top: 0 !important;
    padding: 6px 10px !important;
    white-space: normal !important;
    display: block !important;
}
@media (max-width: 900px) {
    .form-table-head,
    .form-row {
        min-width: 1450px !important;
        grid-template-columns: 60px minmax(360px, 1fr) minmax(260px, .8fr) 110px minmax(480px, 1fr) !important;
    }
    .comment-inline {
        grid-template-columns: minmax(300px, 1fr) 115px !important;
    }
}

/* FINAL COMPACT FIX: keep director comment inside its column; no clipping */
.form-table {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
.form-table-head,
.form-row {
    grid-template-columns: 60px minmax(320px, 1.35fr) minmax(240px, .8fr) 95px 180px !important;
    min-width: 1000px !important;
}
.cell-comment {
    padding: 10px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
.comment-inline {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
}
.comment-inline .comment-area {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 6px 7px !important;
    font-size: 11.5px !important;
    line-height: 1.35 !important;
    box-sizing: border-box !important;
    resize: vertical !important;
    overflow: auto !important;
    display: block !important;
}
.comment-inline .btn-comment {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    box-sizing: border-box !important;
    display: block !important;
}
@media (max-width: 900px) {
    .form-table-head,
    .form-row {
        grid-template-columns: 50px minmax(280px, 1.2fr) minmax(220px, .8fr) 85px 165px !important;
        min-width: 900px !important;
    }
    .cell-comment { padding: 8px !important; }
    .comment-inline .comment-area { font-size: 11px !important; }
}

/* EVIDENCE PAGE WIDTH + ENGLISH-ONLY EVIDENCE FIX */
.page {
    max-width: none !important;
    width: 100% !important;
    margin: 18px 0 90px !important;
    padding: 0 18px 100px !important;
}
.form-table,
.result-table-wrap,
.list-header,
.summary-bar {
    width: 100% !important;
}
.form-table {
    overflow-x: auto !important;
}
.form-table-head,
.form-row {
    grid-template-columns: 58px minmax(420px, 1.45fr) minmax(280px, .85fr) 110px minmax(260px, .75fr) !important;
    min-width: 1260px !important;
}
.cell-question,
.cell-answer,
.cell-status,
.cell-comment {
    min-width: 0 !important;
}
.ev-under-question {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
}
.ev-static-name small,
.evidence-template-table th:nth-child(4),
.evidence-template-table td:nth-child(4) {
    display: none !important;
}
.ev-input,
input.ans-number,
input.ans-url,
select.ans-select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.comment-inline {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
}
.comment-inline .comment-area {
    width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    font-size: 11.5px !important;
    box-sizing: border-box !important;
}
.comment-inline .btn-comment {
    width: 100% !important;
    min-width: 0 !important;
}
.evidence-list-wrap {
    overflow-x: auto !important;
}
.evidence-template-table {
    min-width: 1220px !important;
    width: 100% !important;
}
.evidence-template-table th:nth-child(1),
.evidence-template-table td:nth-child(1) { width: 54px; text-align: center; }
.evidence-template-table th:nth-child(2),
.evidence-template-table td:nth-child(2) { min-width: 210px; }
.evidence-template-table th:nth-child(3),
.evidence-template-table td:nth-child(3) { min-width: 90px; }
.evidence-template-table th:nth-child(4),
.evidence-template-table td:nth-child(4) { display: table-cell !important; min-width: 360px; }
.evidence-template-table th:nth-child(9),
.evidence-template-table td:nth-child(9) { min-width: 150px; }
.evidence-category-row td {
    background: #e8f5e9 !important;
    color: #1b5e20 !important;
    font-weight: 800 !important;
    border-top: 2px solid #3a8c3f !important;
    padding: 11px 12px !important;
    text-transform: uppercase;
    letter-spacing: .25px;
}
@media (max-width: 900px) {
    .page { padding: 0 10px 100px !important; }
    .form-table-head,
    .form-row {
        min-width: 1100px !important;
        grid-template-columns: 50px minmax(340px, 1.3fr) minmax(240px, .8fr) 95px minmax(220px, .7fr) !important;
    }
}


/* FINAL evidence label/link layout fix */
.ev-required {
    color: #c62828 !important;
    font-weight: 800 !important;
}
.ev-static-label::after { content: none !important; }
.ev-static-label {
    color: #2e7033 !important;
}
.ev-code {
    display: inline-block;
    color: #2e7033;
    font-weight: 900;
    margin-right: 4px;
}
.ev-link-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 6px !important;
}
.ev-link-row .ev-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 36px !important;
}
.ev-link-row .btn-mini {
    flex: 0 0 auto !important;
    height: 36px !important;
    min-width: 104px !important;
    margin: 0 !important;
}
.ev-actions .btn-download {
    background: var(--blue) !important;
}
.ev-actions .btn-download:hover {
    background: var(--blue-dark) !important;
}
@media (max-width: 900px) {
    .ev-link-row { flex-wrap: wrap !important; }
    .ev-link-row .btn-mini { width: 100% !important; }
}


/* Result answer removal + category title left alignment */
.evidence-category-row td {
    text-align: left !important;
}
.result-table th,
.result-table td {
    text-align: left;
}
.result-table th:nth-child(3),
.result-table td:nth-child(3),
.result-table th:nth-child(4),
.result-table td:nth-child(4),
.result-table th:nth-child(5),
.result-table td:nth-child(5),
.result-table th:nth-child(6),
.result-table td:nth-child(6) {
    text-align: center;
}


/* Exact evidence list + formula/result refinements */
.page { max-width: 100% !important; width: 100% !important; padding-left: 14px; padding-right: 14px; }
.form-table { width: 100% !important; overflow-x: auto !important; }
.form-table-head { grid-template-columns: 68px minmax(430px,1.5fr) minmax(260px,.8fr) 120px 230px !important; min-width: 1110px !important; }
.form-row { grid-template-columns: 68px minmax(430px,1.5fr) minmax(260px,.8fr) 120px 230px !important; min-width: 1110px !important; }
.ev-required { color: #c62828 !important; font-weight: 800 !important; }
.ev-static-name { text-align: left !important; font-size: 12.5px; line-height: 1.35; }
.ev-static-label { font-weight: 700; }
.ev-code { color: var(--green-dark); }
.calc-result { margin-top: 6px; display: inline-block; padding: 4px 8px; border-radius: 12px; background: #f1f8e9; border: 1px solid #c8e6c9; color: #1b5e20; font-size: 11.5px; font-weight: 700; }
.result-table-wrap { width: 100% !important; overflow-x: auto; }
.result-table { width: 100% !important; min-width: 1120px; }
.result-table th, .result-table td { vertical-align: top; }
.th-left, .td-left, .evidence-name-cell { text-align: left !important; }
.evidence-template-table th:nth-child(4), .evidence-template-table td:nth-child(4) { text-align: left !important; min-width: 360px; }
.result-table tr td:first-child { font-size: 12px; color: #2e7033; }
.result-actions { white-space: nowrap; }
.comment-inline { width: 100% !important; max-width: 100% !important; }
.comment-area { width: 100% !important; max-width: 100% !important; min-width: 0 !important; min-height: 64px !important; font-size: 12px !important; }
.btn-comment { width: 100% !important; font-size: 11px !important; padding: 6px 4px !important; }
@media (max-width: 800px) {
  .form-table-head { display:none; }
  .form-row { display:block !important; min-width: 0 !important; }
  .cell-num,.cell-question,.cell-answer,.cell-status,.cell-comment { border-left:none !important; padding: 10px 12px !important; }
}
.status-actions {
    margin-top: 7px;
}

.approved-info {
    font-size: 11px;
    color: var(--green-dark);
    margin-top: 5px;
    line-height: 1.3;
}

.form-row {
    background: #fff !important;
}

.form-row:hover {
    background: #fafffe !important;
}

.form-row.approved {
    background: #eaf8ee !important;
}

.status-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: 8px !important;
}

.cancel-approve-label {
    display: inline-block !important;
    margin-top: 6px !important;
    background: #fff3e0 !important;
    color: #e65100 !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    width: auto !important;
    min-width: unset !important;
    text-align: center !important;
}

.cancel-approve-label:hover {
    background: #ffe0b2 !important;
}
.result-category-row td {
    background: #e8f3ea;
    font-weight: 700;
    color: #1b5e20;
    padding: 10px 14px;
    border-top: 2px solid #c8e6c9;
}

/* ── SESSION TIMER (Issue 8 fix) ── */
.session-timer {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    background: rgba(255,255,255,.12);
    border-radius: 5px;
    padding: 3px 9px;
    letter-spacing: .3px;
    transition: background .4s, color .4s;
    white-space: nowrap;
}
.session-timer.session-warn {
    background: #fff3cd;
    color: #856404;
    animation: timerPulse 2s ease-in-out infinite;
}
@keyframes timerPulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .65; }
}
/* ── Result page: category grouping ── */
.result-table tr.result-cat-header td { background:#1a5c20; color:#fff; font-size:12.5px; padding:9px 10px; border-top:3px solid #0d3d12; }
.result-table tr.result-cat-header td strong { font-weight:700; }
.cat-weight { display:inline-block; margin-left:8px; font-size:11px; background:rgba(255,255,255,.22); border-radius:3px; padding:1px 6px; letter-spacing:.3px; }
.cat-pct { font-size:11px; color:rgba(0,0,0,.42); margin-left:4px; }
.pts-cell { font-weight:600; color:#1a5c20; }
.result-table tr.result-cat-header .pts-cell { color:#fff; font-weight:700; }

/* ── 2025 reference hints under number inputs ── */
.prev-value-hint { font-size: 11.5px; color: #555; margin-top: 4px; background: #f0f7f0; border: 1px solid #c8e6c9; border-radius: 4px; padding: 3px 8px; display: inline-block; }
.prev-value-hint strong { color: #1a5c20; }

/* ── Statistics tab ── */
.stats-cmp-table td, .stats-cmp-table th { font-size: 12.5px; }
.stats-cmp-table tr.stats-changed td { background: #fff8e1; }
.stats-cmp-table tr.stats-new td { background: #e3f2fd; }
.stats-cmp-table tr.stats-pending-entry td { background: #fff3e0; }

/* ── Notes & Appendices tab ── */
/* ═══════════════════════════════════════════════════
   NOTES & APPENDICES — ACCORDION DESIGN
═══════════════════════════════════════════════════ */

/* Page wrapper */
.notes-wrap {
  padding: 4px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Section accordion card */
.notes-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: box-shadow .2s;
}
.notes-section[open] {
  box-shadow: 0 4px 20px rgba(26,92,32,.12);
  border-color: #a5d6a7;
}

/* Summary / clickable header */
.notes-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #f1f8e9 0%, #fafffe 100%);
  font-size: 14px;
  font-weight: 700;
  color: #1a5c20;
  border-bottom: 1px solid transparent;
  user-select: none;
  transition: background .15s;
}
.notes-section[open] > summary {
  background: linear-gradient(90deg, #e8f5e9 0%, #f1f8e9 100%);
  border-bottom: 1px solid #c8e6c9;
}
.notes-section > summary:hover { background: linear-gradient(90deg, #dcedc8 0%, #f1f8e9 100%); }
.notes-section > summary::-webkit-details-marker { display: none; }
.notes-section > summary::after {
  content: '▸';
  margin-left: auto;
  font-size: 14px;
  color: #81c784;
  transition: transform .2s;
}
.notes-section[open] > summary::after { transform: rotate(90deg); }

/* Section body */
.notes-body {
  padding: 20px 22px 22px;
  overflow-x: auto;
}

/* Individual note item inside a section */
.note-item {
  position: relative;
  padding: 14px 16px 14px 20px;
  margin-bottom: 12px;
  background: #fafffe;
  border: 1px solid #e8f5e9;
  border-left: 4px solid #1a5c20;
  border-radius: 0 8px 8px 0;
}
.note-item:last-child { margin-bottom: 0; }

.note-item h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1a5c20;
  display: flex;
  align-items: center;
  gap: 7px;
}
.note-item h4::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #1a5c20;
  border-radius: 50%;
  flex-shrink: 0;
}
.note-item p {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: #444;
  line-height: 1.6;
}
.note-item p:last-child { margin-bottom: 0; }
.note-item p strong { color: #1a5c20; }

/* Tables inside note items */
.notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}
.notes-table thead th {
  background: #1a5c20;
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}
.notes-table tbody tr:nth-child(even) td { background: #f9fef9; }
.notes-table tbody tr:hover td { background: #e8f5e9; }
.notes-table td {
  border-top: 1px solid #e8e8e8;
  padding: 8px 12px;
  vertical-align: top;
  color: #333;
  line-height: 1.5;
}
.notes-table td:first-child {
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  width: 160px;
}
.notes-table td strong { color: #1a5c20; }

/* Special colour rows for the data-gap table */
.gap-critical td:nth-child(3) { color: #c62828; font-weight: 700; }
.gap-high     td:nth-child(3) { color: #e65100; font-weight: 600; }
.gap-new      td:nth-child(3) { color: #0277bd; font-weight: 600; }
.gap-check    td:nth-child(3) { color: #1565c0; font-weight: 600; }

/* Appendix-specific: section heading inside body */
.notes-body > h4 {
  font-size: 13px;
  font-weight: 700;
  color: #1a5c20;
  margin: 18px 0 8px;
  padding-bottom: 5px;
  border-bottom: 2px solid #c8e6c9;
}
.notes-body > p {
  font-size: 12.5px;
  color: #444;
  line-height: 1.6;
  margin: 0 0 10px;
}

/* Footnote style paragraph (carbon footprint note) */
.notes-body p[style*="12.5px"] {
  background: #f9fef9;
  border: 1px solid #e8f5e9;
  border-left: 3px solid #1a5c20;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 12px !important;
  color: #555;
  line-height: 1.6;
}

/* Bold result line in Appendix 3 */
.notes-body > p strong { color: #1a5c20; font-size: 13.5px; }

/* ═══════════════════════════════════════════════════
   REFERENCE PAGES — SHARED HERO + LAYOUT
═══════════════════════════════════════════════════ */
.ref-hero { display:flex; align-items:center; gap:18px; background:linear-gradient(135deg,#1a5c20 0%,#2e7d32 60%,#388e3c 100%); color:#fff; padding:24px 28px; border-radius:12px; margin-bottom:24px; box-shadow:0 4px 18px rgba(26,92,32,.25); }
.ref-hero--gaps  { background:linear-gradient(135deg,#bf360c 0%,#e64a19 100%); }
.ref-hero--notes { background:linear-gradient(135deg,#1a237e 0%,#283593 100%); }
.ref-hero--app1  { background:linear-gradient(135deg,#004d40 0%,#00695c 100%); }
.ref-hero--app2  { background:linear-gradient(135deg,#1b5e20 0%,#2e7d32 50%,#006064 100%); }
.ref-hero-icon { font-size:42px; flex-shrink:0; }
.ref-hero-text h2 { margin:0 0 4px; font-size:22px; font-weight:700; }
.ref-hero-text p  { margin:0; font-size:13px; opacity:.88; }
.ref-hero-badge { margin-left:auto; flex-shrink:0; background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.35); border-radius:6px; padding:6px 14px; font-size:12px; font-weight:700; white-space:nowrap; }
.ref-hero-badge--warn  { background:rgba(255,255,255,.25); }
.ref-hero-badge--notes { background:rgba(255,255,255,.2); }
.ref-hero-badge--app   { background:rgba(255,255,255,.18); }
.ref-section-title { font-size:15px; font-weight:700; color:#1a5c20; border-bottom:2px solid #c8e6c9; padding-bottom:8px; margin:24px 0 16px; }

/* ═══════════════════════════════════════════════════
   TAB 11 — CHANGES PAGE
═══════════════════════════════════════════════════ */
.ref-grid { display:grid; gap:14px; margin-bottom:24px; }
.ref-grid--3 { grid-template-columns:repeat(3,1fr); }
@media(max-width:900px){ .ref-grid--3{ grid-template-columns:1fr 1fr; } }
@media(max-width:600px){ .ref-grid--3{ grid-template-columns:1fr; } }

.ref-change-card { background:#fff; border:1px solid #e0e0e0; border-radius:10px; padding:18px 16px; position:relative; box-shadow:0 2px 6px rgba(0,0,0,.05); transition:transform .15s,box-shadow .15s; }
.ref-change-card:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.1); }
.ref-change-card--rename { border-top:4px solid #1a5c20; }
.ref-change-card--new    { border-top:4px solid #e65100; }
.ref-change-card--move   { border-top:4px solid #1565c0; }
.ref-change-card--weight { border-top:4px solid #6a1b9a; }
.ref-change-card--merge  { border-top:4px solid #00695c; }
.rcc-num  { position:absolute; top:14px; right:16px; font-size:28px; font-weight:800; color:#f0f0f0; line-height:1; }
.rcc-icon { font-size:26px; margin-bottom:8px; }
.ref-change-card h3 { margin:0 0 8px; font-size:14px; font-weight:700; color:#1a1a1a; }
.ref-change-card p  { margin:0 0 6px; font-size:12.5px; color:#444; line-height:1.55; }
.rcc-theme { font-size:11.5px; color:#666; font-style:italic; background:#f9f9f9; border-radius:4px; padding:5px 8px; margin-top:8px; }
.rcc-new-grid { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.rcc-badge { background:#fff3e0; border:1px solid #ffb74d; border-radius:4px; padding:3px 8px; font-size:11.5px; font-weight:600; color:#e65100; }

.ref-weight-grid { border:1px solid #c8e6c9; border-radius:10px; overflow:hidden; margin-bottom:8px; }
.rwg-row { display:grid; grid-template-columns:2fr .6fr .7fr .7fr .7fr .7fr .8fr; gap:0; }
.rwg-row > span { padding:9px 12px; font-size:12.5px; border-right:1px solid #e8f5e9; border-bottom:1px solid #e8f5e9; }
.rwg-row > span:last-child { border-right:0; }
.rwg-header > span { background:#1a5c20; color:#fff; font-weight:700; font-size:12px; border-color:rgba(255,255,255,.2); }
.rwg-total  > span { background:#e8f5e9; font-weight:700; }
.rwg-highlight > span { background:#fff8e1; }
.rwg-code { font-weight:700; color:#1a5c20; }
.rwg-new  { font-weight:700; color:#1a5c20; }
.rwg-up   { color:#2e7d32; font-weight:700; }
.rwg-down { color:#c62828; font-weight:700; }

/* ═══════════════════════════════════════════════════
   TAB 12 — DATA GAPS
═══════════════════════════════════════════════════ */
.gap-legend { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:20px; }
.gap-pill { padding:5px 14px; border-radius:20px; font-size:12px; font-weight:600; }
.gap-pill--critical { background:#ffebee; color:#c62828; border:1px solid #ef9a9a; }
.gap-pill--high     { background:#fff3e0; color:#e65100; border:1px solid #ffcc80; }
.gap-pill--new      { background:#e3f2fd; color:#0277bd; border:1px solid #90caf9; }
.gap-pill--check    { background:#e8eaf6; color:#283593; border:1px solid #9fa8da; }

.gap-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.gap-card { background:#fff; border-radius:10px; border:1px solid #e0e0e0; overflow:hidden; box-shadow:0 2px 6px rgba(0,0,0,.05); display:flex; flex-direction:column; }
.gap-card--critical { border-left:5px solid #c62828; }
.gap-card--high     { border-left:5px solid #e65100; }
.gap-card--new      { border-left:5px solid #0277bd; }
.gap-card--check    { border-left:5px solid #3949ab; }
.gc-header { display:flex; align-items:center; justify-content:space-between; padding:10px 14px 0; }
.gc-code { font-size:11.5px; font-weight:800; color:#555; font-family:monospace; background:#f5f5f5; border-radius:3px; padding:2px 6px; }
.gc-tag { font-size:11px; font-weight:700; border-radius:12px; padding:2px 8px; }
.gc-tag--critical { background:#ffebee; color:#c62828; }
.gc-tag--high     { background:#fff3e0; color:#e65100; }
.gc-tag--new      { background:#e3f2fd; color:#0277bd; }
.gc-tag--check    { background:#e8eaf6; color:#283593; }
.gap-card h3 { margin:8px 14px 6px; font-size:13.5px; font-weight:700; color:#1a1a1a; }
.gap-card p  { margin:0 14px 10px; font-size:12.5px; color:#555; line-height:1.55; flex:1; }
.gc-footer { padding:8px 14px; background:#fafafa; border-top:1px solid #f0f0f0; }
.gc-party { font-size:11.5px; font-weight:600; color:#1a5c20; }
.gc-party::before { content:'👤 '; }

/* ═══════════════════════════════════════════════════
   TAB 13 — NOTES
═══════════════════════════════════════════════════ */
.notes2-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(420px,1fr)); gap:16px; }
@media(max-width:600px){ .notes2-grid{ grid-template-columns:1fr; } }
.note2-card { background:#fff; border:1px solid #e0e0e0; border-radius:10px; padding:18px; box-shadow:0 2px 6px rgba(0,0,0,.04); }
.note2-card--wide { grid-column: span 2; }
@media(max-width:900px){ .note2-card--wide{ grid-column:span 1; } }
.n2-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.n2-num { background:#1a5c20; color:#fff; border-radius:5px; padding:3px 10px; font-size:11.5px; font-weight:700; }
.n2-ref { font-size:11px; color:#777; font-family:monospace; background:#f5f5f5; border-radius:4px; padding:2px 7px; }
.n2-new { color:#e65100; font-style:normal; font-weight:700; }
.note2-card h3 { margin:0 0 10px; font-size:13.5px; font-weight:700; color:#1a1a1a; }
.note2-card p  { margin:0 0 10px; font-size:12.5px; color:#444; line-height:1.55; }
.n2-table { width:100%; border-collapse:collapse; font-size:12px; }
.n2-table th { background:#1a5c20; color:#fff; padding:6px 10px; text-align:left; }
.n2-table td { border-top:1px solid #e8e8e8; padding:6px 10px; vertical-align:top; }
.n2-table tbody tr:hover td { background:#f9fef9; }
.n2-alert { background:#fff8e1; border:1px solid #ffe082; border-radius:6px; padding:8px 12px; font-size:12px; font-weight:600; color:#e65100; margin-bottom:10px; }
.n2-scope { display:inline-block; border-radius:4px; padding:1px 7px; font-size:11px; font-weight:700; }
.n2-scope--1 { background:#ffebee; color:#c62828; }
.n2-scope--2 { background:#fff3e0; color:#e65100; }
.n2-scope--3 { background:#e3f2fd; color:#0277bd; }
.n2-steps { display:flex; flex-direction:column; gap:10px; }
.n2-step { display:flex; align-items:flex-start; gap:10px; font-size:12.5px; color:#444; line-height:1.5; }
.n2-step-num { width:28px; height:28px; border-radius:50%; background:#1a5c20; color:#fff; font-weight:700; font-size:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.n2-keywords { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.n2-keywords span { background:#e8f5e9; border:1px solid #a5d6a7; border-radius:14px; padding:3px 12px; font-size:12px; font-weight:600; color:#1a5c20; }
.n2-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.n2-tags span { background:#fff3e0; border:1px solid #ffcc80; border-radius:4px; padding:2px 8px; font-size:11.5px; color:#e65100; }

/* ═══════════════════════════════════════════════════
   TAB 14 — APPENDIX 1: SMART BUILDINGS
═══════════════════════════════════════════════════ */
.sb-note { background:#fff8e1; border:1px solid #ffe082; border-radius:8px; padding:12px 16px; font-size:12.5px; color:#555; margin-bottom:20px; line-height:1.55; }
.sb-fields { display:flex; flex-direction:column; gap:16px; }
.sb-field-group { background:#fff; border:1px solid #e0e0e0; border-radius:10px; overflow:hidden; }
.sb-field-label { padding:10px 16px; font-size:13px; font-weight:700; color:#fff; }
.sb-field-b { background:#1a5c20; }
.sb-field-s { background:#c62828; }
.sb-field-e { background:#e65100; }
.sb-field-a { background:#0277bd; }
.sb-field-i { background:#6a1b9a; }
.sb-field-l { background:#f9a825; color:#1a1a1a; }
.sb-req-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:0; }
.sb-req-card { padding:14px 16px; border-left:1px solid #f0f0f0; border-top:1px solid #f0f0f0; }
.sb-req-card--recommended { background:#f1f8e9; }
.sb-req-code { font-size:18px; font-weight:800; color:#1a5c20; margin-bottom:4px; font-family:monospace; }
.sb-req-name { font-size:13px; font-weight:700; color:#1a1a1a; margin-bottom:6px; }
.sb-req-desc { font-size:12px; color:#555; line-height:1.5; }
.sb-recommended { font-size:11px; color:#2e7d32; font-weight:700; margin-top:6px; }
.sb-recommended::before { content:'★ '; }

/* ═══════════════════════════════════════════════════
   TAB 15 — APPENDIX 2 & 3
═══════════════════════════════════════════════════ */
.gbe-grid { display:flex; flex-direction:column; gap:12px; }
.gbe-element { background:#fff; border:1px solid #e0e0e0; border-radius:10px; overflow:hidden; }
.gbe-element--full .gbe-cols { display:block; padding:12px 16px; }
.gbe-num   { width:36px; height:36px; background:#1a5c20; color:#fff; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:16px; font-weight:800; margin:14px 0 0 16px; }
.gbe-title { font-size:14px; font-weight:700; color:#1a1a1a; padding:6px 16px 10px; }
.gbe-cols  { display:grid; grid-template-columns:1fr 1fr; gap:0; border-top:1px solid #e8e8e8; }
@media(max-width:700px){ .gbe-cols{ grid-template-columns:1fr; } }
.gbe-cols > div { padding:12px 16px; }
.gbe-cols > div:first-child { border-right:1px solid #e8e8e8; }
.gbe-col-head { font-size:11.5px; font-weight:700; color:#1a5c20; text-transform:uppercase; letter-spacing:.5px; margin-bottom:8px; }
.gbe-cols ul { margin:0; padding:0 0 0 16px; }
.gbe-cols li { font-size:12px; color:#444; margin-bottom:3px; line-height:1.45; }
.gbe-tags { display:flex; flex-wrap:wrap; gap:7px; }
.gbe-tags span { background:#e8f5e9; border:1px solid #a5d6a7; border-radius:5px; padding:4px 12px; font-size:12px; color:#1a5c20; }

/* Carbon footprint */
.cf-layout { display:grid; grid-template-columns:240px 1fr; gap:20px; align-items:start; margin-bottom:20px; }
@media(max-width:700px){ .cf-layout{ grid-template-columns:1fr; } }
.cf-result-card { background:linear-gradient(135deg,#1a5c20,#2e7d32); color:#fff; border-radius:12px; padding:24px 20px; text-align:center; box-shadow:0 4px 16px rgba(26,92,32,.3); }
.cfr-label { font-size:11px; font-weight:600; opacity:.8; text-transform:uppercase; letter-spacing:.5px; margin-bottom:8px; }
.cfr-value { font-size:52px; font-weight:800; line-height:1; }
.cfr-unit  { font-size:13px; opacity:.85; margin-top:4px; }
.cfr-note  { font-size:11px; opacity:.7; margin-top:12px; line-height:1.4; }
.cf-breakdown { display:flex; flex-direction:column; gap:12px; }
.cfb-item { background:#fff; border:1px solid #e0e0e0; border-radius:8px; padding:12px 16px; }
.cfb-bar  { height:6px; background:#1a5c20; border-radius:3px; margin-bottom:8px; min-width:3px; transition:width .5s; }
.cfb-label { font-size:13px; font-weight:600; color:#1a1a1a; }
.cfb-val   { font-size:16px; font-weight:800; color:#1a5c20; margin:2px 0; }
.cfb-detail { font-size:11.5px; color:#777; font-family:monospace; }
.cf-formulas { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; }
.cf-formula-block { background:#fff; border:1px solid #e0e0e0; border-radius:8px; padding:14px 16px; }
.cf-formula-block--warn { background:#fff8e1; border-color:#ffe082; }
.cff-title  { font-size:11.5px; font-weight:700; color:#1a5c20; text-transform:uppercase; letter-spacing:.4px; margin-bottom:8px; }
.cff-formula { font-size:13px; color:#1a1a1a; font-family:monospace; line-height:1.6; }

/* ═══════════════════════════════════════════════════
   STATISTICS TAB — FULL REDESIGN
═══════════════════════════════════════════════════ */

/* Hero bar */
.stat-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; background:linear-gradient(135deg,#1a1f6b 0%,#1a5c20 100%); color:#fff; padding:22px 28px; border-radius:12px; margin-bottom:20px; box-shadow:0 4px 20px rgba(26,31,107,.3); flex-wrap:wrap; }
.stat-hero-left { display:flex; align-items:center; gap:16px; }
.stat-hero-icon { font-size:40px; }
.stat-hero-left h2 { margin:0 0 4px; font-size:20px; font-weight:700; }
.stat-hero-left p  { margin:0; font-size:12.5px; opacity:.85; }
.stat-hero-kpis { display:flex; gap:10px; flex-wrap:wrap; }
.stat-kpi { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); border-radius:10px; padding:10px 18px; text-align:center; min-width:80px; }
.stat-kpi--green  { background:rgba(46,125,50,.4); border-color:rgba(46,125,50,.6); }
.stat-kpi--orange { background:rgba(230,81,0,.4); border-color:rgba(230,81,0,.6); }
.stat-kpi--red    { background:rgba(198,40,40,.35); border-color:rgba(198,40,40,.5); }
.sk-val   { font-size:26px; font-weight:800; line-height:1; }
.sk-label { font-size:11px; opacity:.8; margin-top:4px; white-space:nowrap; }

/* Legend */
.stat-legend { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:20px; padding:10px 14px; background:#f9fef9; border:1px solid #c8e6c9; border-radius:8px; }
.sl-item { font-size:12px; font-weight:600; padding:3px 10px; border-radius:12px; }
.sl-same    { background:#f5f5f5; color:#555; border:1px solid #e0e0e0; }
.sl-up      { background:#e8f5e9; color:#2e7d32; border:1px solid #a5d6a7; }
.sl-down    { background:#ffebee; color:#c62828; border:1px solid #ef9a9a; }
.sl-pending { background:#fff8e1; color:#e65100; border:1px solid #ffe082; }
.sl-new     { background:#e3f2fd; color:#0277bd; border:1px solid #90caf9; }

/* Section */
.stat-section { margin-bottom:28px; }
.stat-sec-header { display:flex; align-items:center; gap:12px; border-left:5px solid #1a5c20; padding:8px 14px; background:#fff; border-radius:0 8px 8px 0; margin-bottom:14px; box-shadow:0 2px 6px rgba(0,0,0,.05); }
.stat-sec-icon { font-size:22px; }
.stat-sec-name { font-size:15px; font-weight:700; color:#1a1a1a; flex:1; }
.stat-sec-code { font-size:13px; font-weight:800; letter-spacing:.5px; padding:2px 8px; background:#f5f5f5; border-radius:4px; }

/* Cards grid */
.stat-cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
@media(max-width:600px){ .stat-cards-grid{ grid-template-columns:1fr 1fr; } }
@media(max-width:400px){ .stat-cards-grid{ grid-template-columns:1fr; } }

/* Individual stat card */
.stat-card { background:#fff; border:1px solid #e8e8e8; border-radius:10px; padding:14px; box-shadow:0 2px 8px rgba(0,0,0,.05); transition:transform .15s,box-shadow .15s; display:flex; flex-direction:column; gap:8px; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,.1); }
.stat-card--up      { border-top:3px solid #2e7d32; }
.stat-card--down    { border-top:3px solid #c62828; }
.stat-card--same    { border-top:3px solid #9e9e9e; }
.stat-card--pending { border-top:3px solid #bdbdbd; background:#fafafa; }
.stat-card--new     { border-top:3px solid #0288d1; background:#f3f9ff; }

/* Card top row */
.sc-top { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.sc-qid { font-size:11px; font-weight:800; color:#888; font-family:monospace; background:#f5f5f5; border-radius:3px; padding:1px 6px; }
.sc-badge { font-size:11px; font-weight:700; border-radius:10px; padding:2px 8px; white-space:nowrap; }
.sc-up      { background:#e8f5e9; color:#2e7d32; }
.sc-down    { background:#ffebee; color:#c62828; }
.sc-same    { background:#f5f5f5; color:#757575; }
.sc-pending { background:#fff8e1; color:#e65100; }
.sc-new     { background:#e3f2fd; color:#0277bd; }

/* Item name */
.sc-item { font-size:12.5px; font-weight:600; color:#1a1a1a; line-height:1.4; min-height:32px; }

/* Values comparison */
.sc-values { display:grid; grid-template-columns:1fr 20px 1fr; align-items:start; margin-top:4px; }
.sc-divider { border-left:2px dashed #e0e0e0; height:100%; margin:0 auto; }
.sc-val-col { display:flex; flex-direction:column; gap:4px; }
.sc-val-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:#aaa; }
.sc-val-num { font-size:17px; font-weight:800; color:#1a1a1a; line-height:1.2; word-break:break-all; }
.sc-val-num--25 { color:#555; font-size:15px; }
.sc-val-num--26 { color:#1a5c20; }
.sc-val-num.sc-up   { color:#2e7d32; }
.sc-val-num.sc-down { color:#c62828; }

/* Mini bar */
.sc-bar-wrap { height:5px; background:#f0f0f0; border-radius:3px; margin-top:4px; overflow:hidden; }
.sc-bar { height:100%; border-radius:3px; transition:width .6s cubic-bezier(.4,0,.2,1); }
.sc-bar--25 { background:#bdbdbd; }
.sc-bar--26 { background:#1a5c20; }
.stat-card--down  .sc-bar--26 { background:#c62828; }
.stat-card--same  .sc-bar--26 { background:#9e9e9e; }
.stat-card--pending .sc-bar--26,
.stat-card--new     .sc-bar--26 { background:#0288d1; }

/* Remove old stats-cmp-table styles if any */
.stats-cmp-table td, .stats-cmp-table th { font-size: 12.5px; }

/* ═══════════════════════════════════════════════════
   REFERENCE PAGES v2 — SHARED
═══════════════════════════════════════════════════ */
.rp-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; background:linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%); color:#fff; padding:24px 28px; border-radius:14px; margin-bottom:24px; box-shadow:0 6px 24px rgba(0,0,0,.2); }
.rp-hero-left { flex:1; }
.rp-hero-eyebrow { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1.5px; opacity:.75; margin-bottom:6px; }
.rp-hero-title { font-size:22px; font-weight:800; margin:0 0 6px; line-height:1.2; }
.rp-hero-sub { font-size:13px; opacity:.85; margin:0; line-height:1.5; }
.rp-hero-emblem { font-size:56px; opacity:.9; flex-shrink:0; }
.rp-section-head { font-size:14px; font-weight:800; color:#1a5c20; text-transform:uppercase; letter-spacing:.8px; border-left:4px solid #1a5c20; padding:6px 12px; background:#f1f8e9; border-radius:0 6px 6px 0; margin:24px 0 14px; }
.rp-section-head2 { font-size:15px; font-weight:800; color:#1a1a1a; border-bottom:3px solid #1a5c20; padding-bottom:8px; margin:0 0 16px; display:flex; align-items:center; gap:8px; }
.rp-section-head2::before { content:''; display:inline-block; width:10px; height:10px; background:#1a5c20; border-radius:50%; }

/* ═══════════════════════════════════════════════════
   TAB 11 — CHANGES
═══════════════════════════════════════════════════ */
.rp-changes-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:28px; }
@media(max-width:900px){ .rp-changes-grid{ grid-template-columns:1fr 1fr; } }
@media(max-width:560px){ .rp-changes-grid{ grid-template-columns:1fr; } }

.rp-change-card { background:#fff; border-radius:12px; border:1px solid #e8e8e8; border-top:4px solid var(--accent,#1a5c20); padding:16px 16px 14px; box-shadow:0 2px 8px rgba(0,0,0,.05); display:flex; flex-direction:column; gap:6px; position:relative; transition:transform .15s,box-shadow .15s; }
.rp-change-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.1); }
.rp-change-card--wide { grid-column:span 2; }
@media(max-width:560px){ .rp-change-card--wide{ grid-column:span 1; } }
.rpc-number { position:absolute; top:12px; right:14px; font-size:32px; font-weight:900; color:#f0f0f0; line-height:1; pointer-events:none; }
.rpc-icon { font-size:28px; margin-bottom:2px; }
.rpc-content h3 { margin:0 0 6px; font-size:14px; font-weight:700; color:#1a1a1a; }
.rpc-content p  { margin:0 0 6px; font-size:12.5px; color:#444; line-height:1.55; }
.rpc-tag { font-size:11.5px; color:#666; background:#f9f9f9; border-radius:5px; padding:5px 9px; font-style:italic; margin-top:4px; }
.rpc-tag--warn { background:#fff3e0; color:#e65100; font-style:normal; font-weight:600; border:1px solid #ffcc80; }
.rpc-chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.rpc-chips span { background:#e8f5e9; border:1px solid #a5d6a7; border-radius:4px; padding:2px 8px; font-size:11.5px; color:#1a5c20; font-weight:600; }
.rpc-chips--mono span { font-family:monospace; font-size:12px; background:#f3e5f5; border-color:#ce93d8; color:#6a1b9a; }
.rpc-chip-arrow { background:transparent !important; border:none !important; color:#999 !important; font-size:16px !important; font-weight:400 !important; }
.rpc-weights { display:grid; grid-template-columns:1fr 1fr; gap:4px; margin-top:6px; }
.rpw-item { display:flex; align-items:center; gap:6px; font-size:12px; padding:3px 0; }
.rpw-code { font-weight:800; font-size:12px; width:24px; color:#1a5c20; }
.rpw-delta { margin-left:auto; font-size:11px; font-weight:700; padding:1px 6px; border-radius:3px; }
.rpw-down .rpw-delta { background:#ffebee; color:#c62828; }
.rpw-up  .rpw-delta  { background:#e8f5e9; color:#2e7d32; }
.rpw-new .rpw-delta  { background:#e3f2fd; color:#0277bd; }
.rpc-new-indicators { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:8px; }
@media(max-width:560px){ .rpc-new-indicators{ grid-template-columns:1fr 1fr; } }
.rpni-item { background:#fff3e0; border:1px solid #ffcc80; border-radius:8px; padding:8px 10px; display:flex; flex-direction:column; gap:3px; }
.rpni-code { font-size:11px; font-weight:800; color:#e65100; font-family:monospace; }
.rpni-label { font-size:12px; font-weight:600; color:#333; }
.rpc-dates { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; }
.rpd-item { background:#f1f8e9; border-radius:6px; padding:8px 10px; }
.rpd-label { font-size:10.5px; font-weight:700; color:#888; text-transform:uppercase; letter-spacing:.4px; }
.rpd-val { font-size:14px; font-weight:700; color:#1a5c20; margin-top:2px; }

/* Weight table */
.rp-weight-table { border:1px solid #c8e6c9; border-radius:10px; overflow:hidden; }
.rpwt-head, .rpwt-row { display:grid; grid-template-columns:2.2fr .5fr 1fr 1fr .7fr; }
.rpwt-head > span, .rpwt-row > span { padding:9px 12px; font-size:12.5px; border-right:1px solid #e8f5e9; border-bottom:1px solid #e8f5e9; }
.rpwt-head > span:last-child, .rpwt-row > span:last-child { border-right:0; }
.rpwt-head > span { background:#1a5c20; color:#fff; font-weight:700; font-size:12px; }
.rpwt-group { display:flex !important; gap:0; padding:0 !important; }
.rpwt-group em { flex:1; padding:9px 10px; font-style:normal; border-right:1px solid #e8f5e9; }
.rpwt-group em:last-child { border-right:0; }
.rpwt-group.rpwt-new em { font-weight:700; color:#1a5c20; }
.rpwt-code { font-weight:800; color:#1a5c20; }
.rpwt-delta { font-weight:700; }
.rpwt-down { color:#c62828; }
.rpwt-up   { color:#2e7d32; }
.rpwt-new-entry { color:#0277bd; font-weight:700; }
.rpwt-row--highlight > span, .rpwt-row--highlight .rpwt-group em { background:#fff8e1; }
.rpwt-row--total > span, .rpwt-row--total .rpwt-group em { background:#e8f5e9; }
.rpwt-row:last-child > span, .rpwt-row:last-child .rpwt-group em { border-bottom:0; }

/* ═══════════════════════════════════════════════════
   TAB 12 — DATA GAPS
═══════════════════════════════════════════════════ */
.dg-priority-bar { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:24px; }
@media(max-width:600px){ .dg-priority-bar{ grid-template-columns:1fr 1fr; } }
.dgp-item { border-radius:10px; padding:14px 16px; text-align:center; }
.dgp-critical { background:#ffebee; border:2px solid #ef9a9a; }
.dgp-high     { background:#fff3e0; border:2px solid #ffcc80; }
.dgp-new      { background:#e3f2fd; border:2px solid #90caf9; }
.dgp-check    { background:#e8eaf6; border:2px solid #9fa8da; }
.dgp-count { font-size:32px; font-weight:900; line-height:1; }
.dgp-critical .dgp-count { color:#c62828; }
.dgp-high     .dgp-count { color:#e65100; }
.dgp-new      .dgp-count { color:#0277bd; }
.dgp-check    .dgp-count { color:#283593; }
.dgp-label { font-size:12px; font-weight:700; margin-top:4px; color:#333; }

.dg-group { margin-bottom:24px; }
.dg-group-head { font-size:13px; font-weight:700; padding:9px 14px; border-radius:8px 8px 0 0; margin-bottom:0; }
.dg-group-head--critical { background:#c62828; color:#fff; }
.dg-group-head--high     { background:#e65100; color:#fff; }
.dg-group-head--new      { background:#0277bd; color:#fff; }
.dg-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:0; border:1px solid #e0e0e0; border-top:0; border-radius:0 0 8px 8px; overflow:hidden; }
.dg-card { background:#fff; padding:16px; border-right:1px solid #e8e8e8; border-bottom:1px solid #e8e8e8; display:flex; flex-direction:column; gap:6px; }
.dg-card:hover { background:#fafffe; }
.dg-card--critical { border-left:4px solid #c62828; }
.dg-card--high     { border-left:4px solid #e65100; }
.dg-card--new      { border-left:4px solid #0277bd; }
.dg-card--check    { border-left:4px solid #3949ab; }
.dgc-top { display:flex; align-items:flex-start; gap:8px; flex-direction:column; }
code.dgc-code { font-size:11px; font-weight:800; background:#f5f5f5; border:1px solid #e0e0e0; border-radius:4px; padding:2px 7px; color:#555; }
.dgc-indicator-name { font-size:13.5px; font-weight:700; color:#1a1a1a; line-height:1.3; }
.dg-card p { margin:0; font-size:12.5px; color:#555; line-height:1.55; flex:1; }
.dgc-action { background:#fafafa; border:1px solid #e8e8e8; border-radius:6px; padding:8px 10px; font-size:12px; }
.dgc-action-label { font-size:10.5px; font-weight:700; color:#888; text-transform:uppercase; letter-spacing:.4px; margin-bottom:3px; }
.dgc-action-text { color:#333; line-height:1.4; }
.dgc-footer { display:flex; align-items:center; justify-content:space-between; padding-top:6px; border-top:1px solid #f0f0f0; margin-top:auto; }
.dgc-party { font-size:11.5px; font-weight:700; color:#1a5c20; }
.dgc-deadline { font-size:11px; color:#999; }

/* ═══════════════════════════════════════════════════
   TAB 13 — NOTES
═══════════════════════════════════════════════════ */
.notes-list { display:flex; flex-direction:column; gap:16px; }
.nl-note { display:flex; gap:0; background:#fff; border:1px solid #e0e0e0; border-radius:12px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.nl-note--new { border-color:#bbdefb; }
.nl-sidebar { background:#1a5c20; color:#fff; display:flex; flex-direction:column; align-items:center; padding:16px 12px; gap:8px; min-width:64px; flex-shrink:0; }
.nl-note--new .nl-sidebar { background:#1a237e; }
.nl-num { font-size:24px; font-weight:900; line-height:1; }
.nl-ref { font-size:10px; font-weight:600; text-align:center; opacity:.8; line-height:1.4; font-family:monospace; }
.nl-new-badge { background:rgba(255,255,255,.2); border-radius:4px; padding:2px 5px; font-size:10px; font-weight:700; text-align:center; white-space:nowrap; }
.nl-body { padding:18px 20px; flex:1; }
.nl-body h3 { margin:0 0 12px; font-size:15px; font-weight:700; color:#1a1a1a; }
.nl-body p  { margin:0 0 10px; font-size:13px; color:#444; line-height:1.55; }
.nl-tags-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:8px; }
.nl-tag-item { display:flex; gap:10px; background:#f9fef9; border:1px solid #e8f5e9; border-radius:8px; padding:10px 12px; align-items:flex-start; }
.nl-tag-icon { font-size:20px; flex-shrink:0; margin-top:1px; }
.nl-tag-text { font-size:12.5px; color:#333; line-height:1.45; }
.nl-tag-text strong { display:block; color:#1a1a1a; margin-bottom:2px; }
.nl-def-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; }
.nl-def-grid--2 { grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); }
.nl-def-card { background:#f9fef9; border:1px solid #e8f5e9; border-radius:8px; padding:12px; }
.nl-def-icon { font-size:22px; margin-bottom:6px; }
.nl-def-card strong { display:block; font-size:13px; color:#1a1a1a; margin-bottom:5px; }
.nl-def-card p { margin:0; font-size:12px; color:#555; line-height:1.5; }
.nl-alert { border-radius:8px; padding:9px 14px; font-size:12.5px; font-weight:600; margin-bottom:12px; }
.nl-alert--warn { background:#fff8e1; border:1px solid #ffe082; color:#e65100; }
.nl-scope-blocks { display:flex; flex-direction:column; gap:10px; }
.nl-scope { border-radius:8px; overflow:hidden; border:1px solid; }
.nl-scope--1 { border-color:#ef9a9a; }
.nl-scope--2 { border-color:#ffcc80; }
.nl-scope--3 { border-color:#90caf9; }
.nl-scope-head { padding:7px 12px; font-size:12px; font-weight:700; }
.nl-scope--1 .nl-scope-head { background:#ffebee; color:#c62828; }
.nl-scope--2 .nl-scope-head { background:#fff3e0; color:#e65100; }
.nl-scope--3 .nl-scope-head { background:#e3f2fd; color:#0277bd; }
.nl-scope-items { padding:6px 12px 10px; display:flex; flex-direction:column; gap:5px; }
.nl-scope-item { display:flex; gap:8px; font-size:12.5px; }
.nl-scope-item strong { min-width:160px; color:#1a1a1a; flex-shrink:0; }
.nl-scope-item span { color:#555; line-height:1.45; }
.nl-steps-h { display:flex; align-items:flex-start; gap:0; flex-wrap:wrap; }
.nl-step-h { flex:1; min-width:130px; background:#f9fef9; border:1px solid #e8f5e9; border-radius:8px; padding:12px; }
.nlsh-num { width:28px; height:28px; background:#1a5c20; color:#fff; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px; margin-bottom:6px; }
.nlsh-label { font-size:13px; font-weight:700; color:#1a1a1a; margin-bottom:4px; }
.nlsh-desc { font-size:12px; color:#555; line-height:1.5; }
.nl-step-h-arrow { display:flex; align-items:center; padding:0 6px; font-size:22px; color:#c8e6c9; flex-shrink:0; margin-top:14px; }
@media(max-width:700px){ .nl-step-h-arrow{ display:none; } .nl-step-h{ min-width:100%; } }
.nl-ped-cards { display:flex; align-items:flex-start; gap:0; flex-wrap:wrap; }
.nl-ped-card { flex:1; min-width:160px; border-radius:8px; padding:14px; }
.nl-ped-card--s { background:#e8f5e9; border:1px solid #a5d6a7; }
.nl-ped-card--c { background:#e3f2fd; border:1px solid #90caf9; }
.nl-ped-card--d { background:#f3e5f5; border:1px solid #ce93d8; }
.nlp-icon { font-size:24px; margin-bottom:6px; }
.nlp-label { font-size:13px; font-weight:700; color:#1a1a1a; margin-bottom:4px; }
.nlp-desc { font-size:12px; color:#444; line-height:1.5; }
.nl-ped-plus { display:flex; align-items:center; padding:0 8px; font-size:22px; color:#bdbdbd; margin-top:14px; }
@media(max-width:600px){ .nl-ped-plus{ display:none; } .nl-ped-card{ min-width:100%; } }
.nl-keywords { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.nl-keywords span { background:#e8f5e9; border:1px solid #a5d6a7; border-radius:16px; padding:4px 14px; font-size:13px; font-weight:700; color:#1a5c20; }
.nl-table-box { border-radius:8px; overflow:hidden; border:1px solid #e0e0e0; }
.nl-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.nl-table th { background:#1a5c20; color:#fff; padding:8px 12px; text-align:left; }
.nl-note--new .nl-table th { background:#1a237e; }
.nl-table td { border-top:1px solid #e8e8e8; padding:8px 12px; vertical-align:top; line-height:1.5; }
.nl-table td:first-child { font-weight:600; color:#1a1a1a; white-space:nowrap; width:180px; }
.nl-table tbody tr:hover td { background:#fafffe; }

/* ═══════════════════════════════════════════════════
   TAB 14 — APPENDIX 1: SMART BUILDINGS
═══════════════════════════════════════════════════ */
.sb2-alert { display:flex; align-items:flex-start; gap:12px; background:#fff8e1; border:2px solid #ffe082; border-radius:10px; padding:14px 18px; font-size:13px; color:#555; margin-bottom:20px; line-height:1.55; }
.sb2-alert-icon { font-size:22px; color:#f9a825; flex-shrink:0; margin-top:1px; }
.sb2-fields { display:flex; flex-direction:column; gap:16px; }
.sb2-field { background:#fff; border:1px solid #e0e0e0; border-radius:12px; overflow:hidden; box-shadow:0 2px 6px rgba(0,0,0,.04); }
.sb2-field-hd { display:flex; align-items:center; gap:12px; padding:12px 18px; color:#fff; font-size:14px; font-weight:700; }
.sb2-fcode { font-size:22px; font-weight:900; width:36px; height:36px; border-radius:8px; background:rgba(255,255,255,.2); display:flex; align-items:center; justify-content:center; }
.sb2-field-hd--B { background:#1a5c20; }
.sb2-field-hd--S { background:#c62828; }
.sb2-field-hd--E { background:#e65100; }
.sb2-field-hd--A { background:#0277bd; }
.sb2-field-hd--I { background:#6a1b9a; }
.sb2-field-hd--L { background:#f57f17; }
.sb2-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); }
.sb2-card { padding:14px 16px; border-left:1px solid #f0f0f0; border-top:1px solid #f0f0f0; transition:background .12s; }
.sb2-card:hover { background:#fafffe; }
.sb2-card--star { background:#f1f8e9; }
.sb2-card-code { font-size:22px; font-weight:900; color:#1a5c20; margin-bottom:4px; font-family:monospace; line-height:1; }
.sb2-card-name { font-size:13px; font-weight:700; color:#1a1a1a; margin-bottom:6px; }
.sb2-card-desc { font-size:12px; color:#666; line-height:1.5; }
.sb2-card-star { font-size:11px; color:#2e7d32; font-weight:700; margin-top:6px; }
.sb2-card-star::before { content:'★ '; }

/* ═══════════════════════════════════════════════════
   TAB 15 — APPENDIX 2 & 3
═══════════════════════════════════════════════════ */
.gbe2-grid { display:flex; flex-direction:column; gap:14px; }
.gbe2-card { background:#fff; border:1px solid #e0e0e0; border-radius:12px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,.04); }
.gbe2-card--full {}
.gbe2-num { display:inline-flex; width:32px; height:32px; background:#1a5c20; color:#fff; border-radius:50%; align-items:center; justify-content:center; font-weight:800; font-size:15px; margin:14px 0 0 16px; }
.gbe2-icon { font-size:22px; margin:0 0 0 8px; display:inline; }
.gbe2-title { font-size:14px; font-weight:700; color:#1a1a1a; padding:4px 16px 12px; display:block; border-bottom:1px solid #e8e8e8; }
.gbe2-same { font-size:12px; font-weight:400; color:#999; }
.gbe2-cols { display:grid; grid-template-columns:1fr 1fr; }
@media(max-width:680px){ .gbe2-cols{ grid-template-columns:1fr; } }
.gbe2-col { padding:12px 16px; }
.gbe2-col:first-child { border-right:1px solid #e8e8e8; }
.gbe2-col-head { font-size:11px; font-weight:800; color:#1a5c20; text-transform:uppercase; letter-spacing:.6px; margin-bottom:8px; background:#e8f5e9; border-radius:4px; padding:3px 8px; display:inline-block; }
.gbe2-col ul { margin:8px 0 0; padding:0 0 0 16px; }
.gbe2-col li { font-size:12.5px; color:#444; margin-bottom:4px; line-height:1.45; }
.gbe2-tags { display:flex; flex-wrap:wrap; gap:7px; padding:12px 16px; }
.gbe2-tags span { background:#e8f5e9; border:1px solid #a5d6a7; border-radius:6px; padding:5px 12px; font-size:12.5px; color:#1a5c20; font-weight:600; }

/* Carbon Footprint */
.cf2-layout { display:grid; grid-template-columns:220px 1fr; gap:20px; margin-bottom:20px; }
@media(max-width:680px){ .cf2-layout{ grid-template-columns:1fr; } }
.cf2-result { background:linear-gradient(160deg,#1a1f6b 0%,#1a5c20 100%); color:#fff; border-radius:14px; padding:24px 18px; text-align:center; box-shadow:0 6px 20px rgba(26,31,107,.3); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.cf2r-top  { font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; opacity:.7; margin-bottom:10px; }
.cf2r-big  { font-size:56px; font-weight:900; line-height:1; }
.cf2r-unit { font-size:13px; opacity:.8; margin-top:4px; }
.cf2r-note { font-size:11px; opacity:.65; margin-top:12px; line-height:1.4; max-width:180px; }
.cf2-parts { display:flex; flex-direction:column; gap:10px; }
.cf2p-item { background:#fff; border:1px solid #e0e0e0; border-radius:10px; padding:12px 16px; }
.cf2p-header { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.cf2p-num  { font-size:11px; font-weight:800; color:#fff; background:#1a5c20; border-radius:4px; padding:2px 7px; white-space:nowrap; }
.cf2p-name { font-size:13px; font-weight:600; color:#1a1a1a; flex:1; }
.cf2p-val  { font-size:16px; font-weight:800; color:#1a5c20; }
.cf2p-val--zero { color:#bdbdbd; }
.cf2p-bar-wrap { height:6px; background:#f0f0f0; border-radius:3px; overflow:hidden; margin-bottom:6px; }
.cf2p-bar { height:100%; background:#1a5c20; border-radius:3px; }
.cf2p-bar--zero { background:#e0e0e0; }
.cf2p-detail { font-size:11.5px; color:#888; font-family:monospace; }
.cf2-formulas { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.cf2f-card { background:#fff; border:1px solid #e0e0e0; border-radius:10px; padding:14px 16px; }
.cf2f-card--warn { background:#fff8e1; border-color:#ffe082; }
.cf2f-title { font-size:12px; font-weight:800; color:#1a5c20; text-transform:uppercase; letter-spacing:.5px; margin-bottom:8px; }
.cf2f-card--warn .cf2f-title { color:#e65100; }
.cf2f-formula { font-size:13.5px; color:#1a1a1a; font-family:monospace; line-height:1.7; }
.cf2f-unit { font-size:11px; color:#888; }

/* Consolidated Notes / Appendixes reference tabs */
.appendix-tabs-note {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:-8px 0 18px;
}
.appendix-tabs-note a {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 13px;
  border:1px solid #d7e8d8;
  border-radius:999px;
  background:#f7fbf7;
  color:#1a5c20;
  text-decoration:none;
  font-size:12.5px;
  font-weight:800;
  box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.appendix-tabs-note a:hover { background:#e8f5e9; border-color:#a5d6a7; }
.appendix-table-card {
  background:#fff;
  border:1px solid #dfe8df;
  border-radius:14px;
  box-shadow:0 3px 12px rgba(0,0,0,.05);
  overflow:hidden;
  margin-bottom:22px;
}
.appendix-table-title {
  padding:13px 16px;
  background:linear-gradient(135deg,#1a5c20,#006064);
  color:#fff;
  font-size:13px;
  font-weight:900;
  letter-spacing:.3px;
  text-transform:uppercase;
}
.appendix-table-wrap { overflow-x:auto; }
.appendix-table {
  width:100%;
  min-width:850px;
  border-collapse:collapse;
  font-size:13px;
}
.appendix-table th {
  background:#f1f7f1;
  color:#1a5c20;
  text-align:left;
  padding:11px 13px;
  font-weight:900;
  border-bottom:1px solid #dfe8df;
  white-space:nowrap;
}
.appendix-table td {
  padding:11px 13px;
  border-top:1px solid #eef2ee;
  vertical-align:top;
  line-height:1.55;
  color:#333;
}
.appendix-table td:first-child {
  font-weight:900;
  color:#1a5c20;
  white-space:nowrap;
}
.appendix-table tbody tr:nth-child(even) td { background:#fbfdfb; }
.appendix-table tbody tr:hover td { background:#f4faf4; }

/* Delete evidence button */
.btn-delete-evidence {
    background: #9E3D2F !important;
    color: #fff !important;
}
.btn-delete-evidence:hover {
    background: #7A2E24 !important;
}

/* ── Admin: editable 2025 values ───────────────────────── */
.btn-hdr-admin {
  background: linear-gradient(135deg, #1f6f43, #2f8f5d);
  color: #fff !important;
  border-color: rgba(255,255,255,.25);
}
.admin-values-page {
  background: #f4f7f2;
  color: #263028;
}
.admin-values-wrap {
  width: min(98vw, 1480px);
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 10px 46px;
}
.admin-values-form { width: 100%; }
.admin-values-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #12351f, #2c6f43 58%, #d7b55b);
  color: #fff;
  box-shadow: 0 18px 40px rgba(18,53,31,.18);
}
.admin-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  opacity: .85;
  font-weight: 800;
}
.admin-values-hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.1;
}
.admin-values-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,.86);
  line-height: 1.65;
}
.admin-hero-card {
  min-width: 160px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 22px;
  background: rgba(255,255,255,.13);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.admin-hero-card span {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}
.admin-hero-card small {
  margin-top: 8px;
  font-weight: 700;
  color: rgba(255,255,255,.82);
}
.admin-alert {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
}
.admin-alert-success {
  background: #e4f5e9;
  color: #145c2f;
  border: 1px solid #b8e4c4;
}
.admin-alert-error {
  background: #fff0ed;
  color: #9e3d2f;
  border: 1px solid #f0c6bd;
}
.admin-table-card {
  background: #fff;
  border: 1px solid #dfe8dc;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(22,62,34,.10);
  overflow: hidden;
}
.admin-table-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid #e6ede4;
  background: linear-gradient(180deg, #fff, #f8fbf6);
}
.admin-table-head h2 {
  margin: 0 0 4px;
  color: #153a24;
}
.admin-table-head p {
  margin: 0;
  color: #657469;
}
.admin-save-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #1f6f43, #2f8f5d);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(31,111,67,.20);
}
.admin-save-btn:hover {
  transform: translateY(-1px);
}
.admin-table-scroll {
  overflow-x: visible;
}
.admin-values-page .admin-table-card {
  width: 100%;
}
.admin-values-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.admin-values-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #244b32;
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  letter-spacing: .02em;
}
.admin-values-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2ea;
  vertical-align: middle;
}
.admin-values-table tr:nth-child(even) td {
  background: #fbfdf9;
}
.admin-values-table input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8e3d3;
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: #263028;
}
.admin-values-table input:focus,
.admin-add-grid input:focus {
  border-color: #2f8f5d;
  box-shadow: 0 0 0 3px rgba(47,143,93,.12);
  outline: none;
}
.admin-values-table .admin-qid {
  font-weight: 900;
  color: #1f6f43;
  background: #f2f8ef;
}
.admin-add-row {
  padding: 20px 22px 24px;
  border-top: 1px solid #e6ede4;
  background: #f7faf5;
}
.admin-add-row h3 {
  margin: 0 0 12px;
  color: #153a24;
}
.admin-add-grid {
  display: grid;
  grid-template-columns: 160px 1fr 220px;
  gap: 12px;
}
.admin-add-grid input {
  border: 1px solid #d8e3d3;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}

.admin-head-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.admin-export-btn,
.admin-chart-btn,
.admin-delete-row-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.admin-export-btn { background:#eef7ef; color:#1f6f43; border:1px solid #cfe5d4; }
.admin-chart-btn { background:#f2f8ef; color:#1f6f43; border:1px solid #cfe5d4; }
.admin-delete-row-btn { background:#fff0ed; color:#9E3D2F; border:1px solid #f0c6bd; }
.admin-chart-btn:hover,
.admin-export-btn:hover { background:#e4f5e9; }
.admin-delete-row-btn:hover { background:#ffe4de; }
.statistics-admin-table { min-width: 0; width: 100%; table-layout: fixed; }
.statistics-admin-table th:nth-child(1), .statistics-admin-table td:nth-child(1) { width: 9%; }
.statistics-admin-table th:nth-child(2), .statistics-admin-table td:nth-child(2) { width: 30%; }
.statistics-admin-table th:nth-child(3), .statistics-admin-table td:nth-child(3),
.statistics-admin-table th:nth-child(4), .statistics-admin-table td:nth-child(4),
.statistics-admin-table th:nth-child(5), .statistics-admin-table td:nth-child(5),
.statistics-admin-table th:nth-child(6), .statistics-admin-table td:nth-child(6) { width: 11%; }
.statistics-admin-table th:nth-child(7), .statistics-admin-table td:nth-child(7) { width: 7%; text-align:center; }
.statistics-admin-table th:nth-child(8), .statistics-admin-table td:nth-child(8) { width: 10%; text-align:center; }
.statistics-admin-table th, .statistics-admin-table td { padding-left: 8px; padding-right: 8px; }
.statistics-admin-table input { padding-left: 9px; padding-right: 9px; }
.statistics-admin-table .admin-chart-btn, .statistics-admin-table .admin-delete-row-btn { padding-left: 10px; padding-right: 10px; width: 100%; }
.admin-add-grid-statistics { grid-template-columns: 140px minmax(260px, 1fr) repeat(4, minmax(95px, 1fr)); }
.stat-chart-modal { display:none; position:fixed; inset:0; z-index:9999; }
.stat-chart-modal.open { display:block; }
.stat-chart-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.45); }
.stat-chart-dialog {
  position:relative;
  width:min(820px, calc(100vw - 34px));
  margin:7vh auto 0;
  background:#fff;
  border-radius:22px;
  box-shadow:0 24px 60px rgba(0,0,0,.24);
  padding:22px;
  border:1px solid #dfe8dc;
}
.stat-chart-dialog h3 { margin:0 42px 6px 0; color:#153a24; }
.stat-chart-dialog p { margin:0 0 16px; color:#657469; line-height:1.5; }
.stat-chart-dialog canvas { width:100%; height:auto; border:1px solid #edf2ea; border-radius:16px; background:#fff; }
.stat-chart-close {
  position:absolute; right:16px; top:14px;
  width:34px; height:34px; border-radius:50%;
  border:1px solid #d8e3d3; background:#f7faf5; color:#153a24;
  font-size:22px; line-height:1; cursor:pointer;
}
@media (max-width: 900px) {
  .admin-add-grid-statistics { grid-template-columns: 1fr 1fr; }
  .admin-head-actions { align-items:stretch; }
}

@media (max-width: 760px) {
  .admin-values-hero,
  .admin-table-head {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-add-grid {
    grid-template-columns: 1fr;
  }
}

/* Result table structure fix: keep all columns visible and keep question labels intact */
.result-table.result-summary-table { table-layout: fixed; min-width: 1450px; }
.result-summary-table th:nth-child(1), .result-summary-table td:nth-child(1) { width: 82px; }
.result-summary-table th:nth-child(2), .result-summary-table td:nth-child(2) { width: 430px; white-space: normal; }
.result-summary-table th:nth-child(3), .result-summary-table td:nth-child(3),
.result-summary-table th:nth-child(4), .result-summary-table td:nth-child(4),
.result-summary-table th:nth-child(5), .result-summary-table td:nth-child(5) { width: 150px; text-align: center; }
.result-summary-table th:nth-child(6), .result-summary-table td:nth-child(6),
.result-summary-table th:nth-child(7), .result-summary-table td:nth-child(7) { width: 95px; text-align: center; }
.result-question-cell { line-height: 1.45; }

/* RESULT_FORMULA_PATCH_V3: keep same design, but prevent hidden/missing result columns */
.result-table.result-summary-table { table-layout: auto !important; min-width: 1720px !important; }
.result-summary-table th:nth-child(1), .result-summary-table td:nth-child(1) { width: 90px !important; min-width: 90px; }
.result-summary-table th:nth-child(2), .result-summary-table td:nth-child(2) { width: 520px !important; min-width: 520px; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
.result-summary-table th:nth-child(3), .result-summary-table td:nth-child(3),
.result-summary-table th:nth-child(4), .result-summary-table td:nth-child(4),
.result-summary-table th:nth-child(5), .result-summary-table td:nth-child(5) { width: 210px !important; min-width: 210px; text-align: center; white-space: normal !important; }
.result-summary-table th:nth-child(6), .result-summary-table td:nth-child(6),
.result-summary-table th:nth-child(7), .result-summary-table td:nth-child(7) { width: 110px !important; min-width: 110px; text-align: center; }
.result-question-cell { line-height: 1.5 !important; }


/* RESULT_CHOSEN_VALUE_COLUMN: separate official selected range from formula result */
.result-summary-table th:nth-child(1), .result-summary-table td:nth-child(1) { width: 90px !important; min-width: 90px; }
.result-summary-table th:nth-child(2), .result-summary-table td:nth-child(2) { width: 500px !important; min-width: 500px; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
.result-summary-table th:nth-child(3), .result-summary-table td:nth-child(3),
.result-summary-table th:nth-child(4), .result-summary-table td:nth-child(4),
.result-summary-table th:nth-child(5), .result-summary-table td:nth-child(5),
.result-summary-table th:nth-child(6), .result-summary-table td:nth-child(6) { width: 190px !important; min-width: 190px; text-align: center; white-space: normal !important; }
.result-summary-table th:nth-child(7), .result-summary-table td:nth-child(7),
.result-summary-table th:nth-child(8), .result-summary-table td:nth-child(8) { width: 105px !important; min-width: 105px; text-align: center; }


/* FINAL 2026 ANSWER RESULT TABLE: six columns only */
.result-table.result-summary-table { table-layout: auto !important; min-width: 1180px !important; }
.result-summary-table th:nth-child(1), .result-summary-table td:nth-child(1) { width: 90px !important; min-width: 90px !important; }
.result-summary-table th:nth-child(2), .result-summary-table td:nth-child(2) { width: 520px !important; min-width: 520px !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
.result-summary-table th:nth-child(3), .result-summary-table td:nth-child(3),
.result-summary-table th:nth-child(4), .result-summary-table td:nth-child(4) { width: 220px !important; min-width: 220px !important; text-align: center !important; white-space: normal !important; }
.result-summary-table th:nth-child(5), .result-summary-table td:nth-child(5),
.result-summary-table th:nth-child(6), .result-summary-table td:nth-child(6) { width: 110px !important; min-width: 110px !important; text-align: center !important; }

/* ── Two-row tab navigation + tab purpose guide ────────── */
.tab-bar.tab-bar-two-rows {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    overflow-x: visible !important;
    padding: 0 8px !important;
    gap: 0;
    align-items: stretch;
}

.tab-bar.tab-bar-two-rows .tab-btn {
    width: 100%;
    min-height: 38px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 8px;
    border-bottom-width: 3px;
}

.tab-guide-card {
    max-width: 1400px;
    margin: 10px auto 0;
    padding: 10px 14px;
    background: #f7fff8;
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    color: #1f2d1f;
}

.tab-guide-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--green-dark);
    margin-bottom: 3px;
}

.tab-guide-desc {
    font-size: 12.8px;
    font-weight: 600;
    color: #2f3a2f;
    margin-bottom: 3px;
}

.tab-guide-features {
    font-size: 12.4px;
    color: var(--muted);
    line-height: 1.45;
}

@media (max-width: 1250px) {
    .tab-bar.tab-bar-two-rows {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
    }
}

@media (max-width: 720px) {
    .tab-bar.tab-bar-two-rows {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
    .tab-guide-card {
        margin: 8px 10px 0;
    }
}

/* ── ADMIN DASHBOARD / TAB PERMISSIONS ───────────────────── */
.badge-admin { background:#135f26; color:#fff; }
.admin-page { max-width: 1600px; margin: 22px auto 80px; padding: 0 14px; }
.admin-card { background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:0 2px 8px rgba(0,0,0,.05); padding:18px; margin-bottom:18px; }
.admin-intro h1 { margin:0 0 6px; color:var(--green-dark); font-size:24px; }
.admin-intro p { margin:0; color:#555; font-size:14px; line-height:1.6; }
.admin-success { margin-top:14px; padding:10px 12px; border:1px solid #9ad59f; background:#effff1; color:#14631f; border-radius:8px; font-weight:700; }
.admin-table-wrap { overflow-x:auto; border:1px solid #dbeedd; border-radius:10px; }
.admin-perm-table { width:100%; border-collapse:collapse; min-width:1500px; font-size:12.5px; }
.admin-perm-table th { background:#2f8b3b; color:#fff; padding:10px 8px; text-align:center; vertical-align:bottom; border-right:1px solid rgba(255,255,255,.18); }
.admin-perm-table th:first-child, .admin-perm-table th:nth-child(2) { text-align:left; }
.admin-perm-table th span { display:block; font-weight:800; font-size:13px; }
.admin-perm-table th small { display:block; font-size:10.5px; line-height:1.25; opacity:.95; max-width:115px; margin:3px auto 0; }
.admin-perm-table td { border-top:1px solid #e4efe5; border-right:1px solid #eef5ef; padding:9px 8px; vertical-align:middle; background:#fff; }
.admin-perm-table tbody tr:nth-child(even) td { background:#fbfffb; }
.admin-perm-table td strong { display:block; color:#073f16; }
.admin-perm-table td small { display:block; color:#666; margin-top:2px; }
.admin-role-pill { display:inline-block; background:#eef8f0; color:#135f26; border:1px solid #bfe2c3; border-radius:999px; padding:4px 8px; font-weight:700; }
.perm-cell label { display:block; white-space:nowrap; margin:3px 0; color:#333; }
.perm-cell input { vertical-align:middle; margin-right:4px; }
.admin-actions { display:flex; justify-content:flex-end; padding-top:16px; }
.admin-save-btn { background:#135f26; color:#fff; border:0; border-radius:8px; padding:11px 22px; font-weight:800; cursor:pointer; box-shadow:0 2px 4px rgba(0,0,0,.12); }
.admin-save-btn:hover { background:#0d4c1c; }
.admin-help h2 { margin:0 0 12px; color:#135f26; font-size:18px; }
.admin-guide-grid { display:grid; grid-template-columns:repeat(4, minmax(180px,1fr)); gap:10px; }
.admin-guide-grid div { border:1px solid #dbeedd; background:#fbfffb; border-radius:8px; padding:10px; }
.admin-guide-grid strong { color:#135f26; margin-right:6px; }
.admin-guide-grid span { color:#333; }

/* ── FULL ADMIN SYSTEM ───────────────────────────────────── */
.admin-system-page { max-width: 1500px; }
.admin-grid-two { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(320px, .8fr); gap: 16px; align-items: start; }
.admin-card h2 { margin: 0 0 12px; color: var(--green-dark); font-size: 18px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-form-grid label { font-size: 12px; font-weight: 700; color: #244b29; display: flex; flex-direction: column; gap: 5px; }
.admin-form-grid input, .admin-form-grid select,
.admin-user-table input, .admin-user-table select { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 8px 9px; font-family: inherit; font-size: 13px; background: #fff; }
.admin-user-table { width: 100%; border-collapse: collapse; min-width: 1050px; }
.admin-user-table th { background: var(--green); color: #fff; padding: 10px; text-align: left; font-size: 12.5px; }
.admin-user-table td { border-bottom: 1px solid var(--row-border); padding: 8px; vertical-align: middle; font-size: 13px; }
.admin-check { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.admin-row-actions { display: flex; gap: 6px; align-items: center; }
.admin-mini-btn { border: 0; background: var(--green); color: #fff; border-radius: 6px; padding: 7px 10px; font-weight: 700; cursor: pointer; }
.admin-danger-btn { background: #a63a2f; }
.admin-error { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #fff0f0; border: 1px solid #f4b5b5; color: #9a1b1b; font-weight: 700; }
.admin-muted { color: #5e6b5f; font-size: 13px; margin: -6px 0 12px; }
.admin-role-guide p { margin: 8px 0; line-height: 1.5; color: #39463b; }
.admin-role-pill { display:inline-block; padding: 4px 8px; border-radius: 999px; background:#e8f4ea; color:#0f5f22; font-size: 12px; font-weight: 800; }
.admin-role-admin { background:#dbeafe; color:#1345a6; }
.admin-role-director { background:#ecfdf5; color:#065f46; }
.admin-role-expert { background:#fff7ed; color:#9a3412; }
.admin-role-viewer { background:#f3f4f6; color:#374151; }
.badge-viewer { background: #f3f4f6; color: #374151; }
@media (max-width: 1100px) { .admin-grid-two { grid-template-columns: 1fr; } .admin-form-grid { grid-template-columns: 1fr; } }

/* ── Modern Admin Dashboard Polish ───────────────────────────── */
.admin-top-header { border-bottom: 1px solid #d8eadb; }
.admin-modern { max-width: 1540px; }
.admin-hero-panel {
    display: grid;
    grid-template-columns: minmax(320px, 1.4fr) minmax(360px, .9fr);
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, #0f5f26, #2f8b3b);
    color: #fff;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: 0 12px 28px rgba(15,95,38,.18);
}
.admin-hero-panel .admin-kicker { color: #d9f7de; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.admin-hero-panel h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.15; }
.admin-hero-panel p { margin: 0; color: #effff2; line-height: 1.65; font-size: 14px; max-width: 760px; }
.admin-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.admin-stat-card { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 14px; padding: 16px; text-align: center; backdrop-filter: blur(4px); }
.admin-stat-card span { display: block; font-size: 30px; font-weight: 900; }
.admin-stat-card small { display: block; margin-top: 2px; color: #e7f6e9; font-weight: 700; }
.admin-layout-grid { display: grid; grid-template-columns: minmax(520px, 1.15fr) minmax(360px, .85fr); gap: 18px; align-items: stretch; margin-bottom: 18px; }
.admin-panel { background: #fff; border: 1px solid #d9ecdc; border-radius: 16px; box-shadow: 0 6px 18px rgba(0,0,0,.055); padding: 18px; margin-bottom: 18px; }
.admin-panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.admin-panel-head h2 { margin: 0 0 4px; color: #0f5f26; font-size: 19px; }
.admin-panel-head p { margin: 0; color: #647166; font-size: 13px; line-height: 1.5; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-form-grid label,
.admin-user-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 800; color: #244b29; }
.admin-form-grid input,
.admin-form-grid select,
.admin-user-fields input,
.admin-user-fields select { width: 100%; border: 1px solid #cfe5d2; border-radius: 9px; padding: 9px 10px; font-family: inherit; font-size: 13px; background: #fff; transition: .16s ease; }
.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-user-fields input:focus,
.admin-user-fields select:focus { outline: none; border-color: #2f8b3b; box-shadow: 0 0 0 3px rgba(47,139,59,.12); }
.role-rule-list { display: grid; gap: 10px; }
.role-rule-list div { border: 1px solid #d9ecdc; background: #fbfffb; border-radius: 12px; padding: 11px 12px; }
.role-rule-list b { display: block; color: #0f5f26; margin-bottom: 3px; }
.role-rule-list span { color: #475348; font-size: 13px; line-height: 1.45; }
.admin-user-cards { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 14px; }
.admin-user-card { border: 1px solid #dceedd; background: #fbfffb; border-radius: 14px; padding: 14px; }
.admin-user-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.admin-user-title strong { display: block; color: #082f14; font-size: 15px; }
.admin-user-title span:not(.admin-role-pill) { display: block; color: #6b746c; font-size: 12px; margin-top: 2px; }
.admin-user-fields { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; }
.admin-user-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.admin-delete-form { margin-top: 8px; text-align: right; }
.admin-save-btn { background: #0f5f26; color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 10px rgba(15,95,38,.16); }
.admin-save-btn:hover { background: #0b4d1f; }
.admin-mini-btn { border: 0; background: #2f8b3b; color: #fff; border-radius: 9px; padding: 8px 12px; font-weight: 800; cursor: pointer; }
.admin-danger-btn { background: #a63a2f; }
.admin-check { display: inline-flex; gap: 7px; align-items: center; color: #314a35; font-size: 13px; font-weight: 800; }
.admin-permission-head { align-items: center; position: sticky; top: 0; background: #fff; z-index: 3; padding-bottom: 12px; border-bottom: 1px solid #e2efe4; }
.permission-section-title { margin: 18px 0 10px; font-weight: 900; color: #0f5f26; background: #eef9f0; border: 1px solid #d2ead6; border-radius: 999px; display: inline-block; padding: 7px 13px; font-size: 13px; }
.admin-permission-grid { display: grid; border: 1px solid #d8eadb; border-radius: 12px; overflow: auto; margin-bottom: 14px; background: #fff; }
.main-permission-grid { grid-template-columns: minmax(145px, 1.05fr) minmax(105px, .7fr) repeat(7, minmax(126px, 1fr)); }
.system-permission-grid { grid-template-columns: minmax(145px, 1.05fr) minmax(105px, .7fr) repeat(7, minmax(126px, 1fr)); }
.perm-grid-head { background: #2f8b3b; color: #fff; padding: 10px 8px; text-align: center; border-right: 1px solid rgba(255,255,255,.22); font-size: 12px; font-weight: 900; min-height: 50px; }
.perm-grid-head b { display: block; font-size: 13px; }
.perm-grid-head span { display: block; font-size: 10.5px; line-height: 1.25; opacity: .95; margin-top: 2px; }
.perm-user-col,
.perm-role-col { text-align: left; }
.perm-user-cell,
.perm-role-cell,
.perm-toggle-cell { border-top: 1px solid #e4efe5; border-right: 1px solid #eef5ef; padding: 9px 8px; min-height: 62px; background: #fff; }
.perm-user-cell strong { display: block; color: #082f14; }
.perm-user-cell small { display: block; color: #68736a; margin-top: 2px; }
.perm-toggle-cell { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.perm-toggle-cell label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: #314a35; }
.perm-toggle-cell input { accent-color: #2f8b3b; }
.admin-role-pill { display: inline-block; padding: 5px 9px; border-radius: 999px; background:#e8f4ea; color:#0f5f22; font-size: 12px; font-weight: 900; text-transform: capitalize; }
.admin-role-admin { background:#dbeafe; color:#1345a6; }
.admin-role-director { background:#ecfdf5; color:#065f46; }
.admin-role-expert { background:#fff7ed; color:#9a3412; }
.admin-role-viewer { background:#f3f4f6; color:#374151; }
@media (max-width: 1100px) {
    .admin-hero-panel,
    .admin-layout-grid { grid-template-columns: 1fr; }
    .admin-user-cards { grid-template-columns: 1fr; }
    .admin-stat-row { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
}
@media (max-width: 720px) {
    .admin-stat-row,
    .admin-form-grid,
    .admin-user-fields { grid-template-columns: 1fr; }
    .admin-panel-head { flex-direction: column; }
}

/* Admin system plus: password, exports, and cleaner dashboard controls */
.admin-button-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:flex-end; margin-top:4px; }
.admin-secondary-btn,
.admin-export-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid #cfe5d2; background:#f7fff8; color:#0f5f26; border-radius:10px; padding:9px 12px; font-weight:900; text-decoration:none; cursor:pointer; font-size:13px; }
.admin-secondary-btn:hover,
.admin-export-btn:hover { background:#eaf8ed; border-color:#98cca0; }
.admin-light-btn { background:#eef8f0 !important; color:#0f5f26 !important; border:1px solid #cfe5d2 !important; }
.admin-export-box { margin-top:18px; padding:14px; border:1px solid #dceedd; border-radius:14px; background:linear-gradient(180deg,#fbfffb,#f5fbf6); }
.admin-export-box h3 { margin:0 0 4px; color:#0f5f26; font-size:16px; }
.admin-export-box p { margin:0 0 10px; color:#5b695d; font-size:13px; line-height:1.5; }
.admin-export-actions { display:grid; grid-template-columns:repeat(2,minmax(130px,1fr)); gap:9px; }
.admin-success { margin-top:10px; padding:10px 12px; border-radius:8px; background:#effaf1; border:1px solid #b8e6bf; color:#0f5f26; font-weight:800; }
.password-page { max-width: 760px; margin:24px auto; }
.password-panel { padding:24px; }
.password-form { display:grid; gap:14px; }
.password-form label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:900; color:#244b29; }
.password-form input { border:1px solid #cfe5d2; border-radius:10px; padding:11px 12px; font-family:inherit; font-size:14px; }
.password-form input:focus { outline:none; border-color:#2f8b3b; box-shadow:0 0 0 3px rgba(47,139,59,.12); }
@media (max-width:700px) { .admin-export-actions { grid-template-columns:1fr; } .admin-button-row { justify-content:stretch; } .admin-button-row > * { flex:1; } }

/* FINAL EXPERT HEADER/TABS + ADMIN DASHBOARD CLEANUP */
body[data-role="expert"] .hdr-right a[href="download.php"],
body[data-role="expert"] .hdr-right a[href="api/download_all_evidence.php"] {
    display: none !important;
}

/* Expert sees only the allowed tabs in one clean row */
body[data-role="expert"] .tab-bar.tab-bar-two-rows {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0 !important;
    padding: 0 8px !important;
    align-items: stretch !important;
}
body[data-role="expert"] .tab-bar.tab-bar-two-rows .tab-btn {
    flex: 1 1 0 !important;
    min-width: 135px !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Cleaner Admin Dashboard layout */
.admin-system-page {
    max-width: 1480px !important;
    padding: 0 18px 90px !important;
}
.admin-hero-panel {
    background: #ffffff !important;
    color: #172018 !important;
    border: 1px solid #d9ecdc !important;
    border-left: 7px solid #2f8b3b !important;
    box-shadow: 0 8px 22px rgba(15,95,38,.08) !important;
    border-radius: 16px !important;
}
.admin-hero-panel .admin-kicker,
.admin-hero-panel h1 { color: #0f5f26 !important; }
.admin-hero-panel p { color: #4f5d51 !important; }
.admin-stat-card {
    background: #f6fff7 !important;
    border: 1px solid #cfe5d2 !important;
    color: #0f5f26 !important;
}
.admin-stat-card small { color: #536456 !important; }
.admin-panel {
    border-radius: 14px !important;
    border: 1px solid #dceedd !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.045) !important;
}
.admin-layout-grid {
    grid-template-columns: minmax(560px, 1.25fr) minmax(380px, .75fr) !important;
}
.admin-panel-head {
    border-bottom: 1px solid #edf5ee;
    padding-bottom: 12px;
}
.admin-form-grid input,
.admin-form-grid select,
.admin-user-fields input,
.admin-user-fields select {
    min-height: 40px;
}
.admin-button-row,
.admin-user-actions,
.admin-export-actions {
    gap: 10px !important;
}
.admin-save-btn,
.admin-mini-btn,
.admin-secondary-btn,
.admin-export-btn {
    border-radius: 8px !important;
}
.admin-user-cards {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
}
.admin-user-card {
    background: #ffffff !important;
    border-left: 4px solid #2f8b3b !important;
}
.admin-permissions-panel {
    overflow: hidden;
}
.admin-permission-grid {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap;
    border-radius: 12px !important;
}
.admin-permission-grid > * {
    white-space: normal;
}
.main-permission-grid,
.system-permission-grid {
    min-width: 1240px !important;
}
.main-permission-grid { display: grid !important; grid-template-columns: minmax(145px, 1.05fr) minmax(105px, .7fr) repeat(7, minmax(126px, 1fr)) !important; }
.system-permission-grid { display: grid !important; grid-template-columns: minmax(145px, 1.05fr) minmax(105px, .7fr) repeat(7, minmax(126px, 1fr)) !important; }
.perm-grid-head {
    background: #1f7a34 !important;
}
.perm-toggle-cell {
    background: #fbfffb !important;
}
.admin-export-box {
    background: #f7fff8 !important;
}
.admin-export-actions {
    grid-template-columns: repeat(2, minmax(150px, 1fr)) !important;
}
@media (max-width: 1100px) {
    .admin-layout-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 900px) {
    body[data-role="expert"] .tab-bar.tab-bar-two-rows .tab-btn { min-width: 170px !important; }
}

/* Formula support for Statistics page */
.statistics-admin-table th:nth-child(1){width:110px;}
.statistics-admin-table th:nth-child(2){width:260px;}
.statistics-admin-table th:nth-child(3){width:230px;}
.statistics-admin-table th:nth-child(4),
.statistics-admin-table th:nth-child(5),
.statistics-admin-table th:nth-child(6),
.statistics-admin-table th:nth-child(7){width:110px;}
.statistics-admin-table th:nth-child(8){width:86px;}
.statistics-admin-table th:nth-child(9){width:86px;}
.formula-cell{display:flex;gap:8px;align-items:center;min-width:220px;}
.formula-cell .admin-formula-input{min-width:130px;flex:1;}
.admin-formula-btn{border:1px solid #d8e6d3;background:#f3f8f1;color:#245332;border-radius:10px;padding:10px 12px;font-weight:800;cursor:pointer;white-space:nowrap;}
.admin-formula-btn.is-formula{background:#e9f6ee;border-color:#9dd5ad;color:#006b39;}
.formula-preview-box{background:#f7faf6;border:1px solid #dfeade;border-radius:14px;padding:16px 18px;color:#102818;font-weight:800;font-family:Consolas, Monaco, monospace;white-space:pre-wrap;word-break:break-word;margin:14px 0;}
.formula-help{font-size:13px;line-height:1.6;color:#536258;margin:0;}
.formula-dialog{max-width:680px;}
.admin-add-grid-statistics{grid-template-columns:120px minmax(220px,1.4fr) minmax(220px,1fr) repeat(4, minmax(95px,1fr));}
@media (max-width:1200px){.admin-add-grid-statistics{grid-template-columns:1fr 1fr;}.formula-cell{min-width:190px;}}

/* Formula indicator UI refinements */
.formula-guide-panel{
  margin: 0 24px 18px;
  padding: 18px 20px;
  border: 1px solid #e3eee0;
  background: #fbfdf9;
  border-radius: 16px;
  box-shadow: none;
}
.formula-guide-title{
  font-weight: 800;
  color: #17462a;
  margin-bottom: 10px;
  font-size: 14px;
}
.formula-guide-grid{
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}
.formula-guide-grid > div{
  border: 1px solid #e8f0e5;
  border-radius: 12px;
  padding: 12px 13px;
  background: #ffffff;
}
.formula-guide-grid strong{
  display: block;
  color: #1f6b3a;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.formula-guide-grid span{
  display: block;
  color: #52645a;
  font-size: 12px;
  line-height: 1.55;
}
.formula-guide-grid code,
.formula-rules-box code{
  background:#f3f8f1;
  border:1px solid #e1ecdd;
  border-radius:6px;
  padding:1px 5px;
  color:#1d6338;
  font-weight:700;
}
.statistics-admin-table th:nth-child(1), .statistics-admin-table td:nth-child(1){width:105px !important;}
.statistics-admin-table th:nth-child(2), .statistics-admin-table td:nth-child(2){width:290px !important;}
.statistics-admin-table th:nth-child(3), .statistics-admin-table td:nth-child(3){width:330px !important;}
.statistics-admin-table th:nth-child(4), .statistics-admin-table td:nth-child(4),
.statistics-admin-table th:nth-child(5), .statistics-admin-table td:nth-child(5),
.statistics-admin-table th:nth-child(6), .statistics-admin-table td:nth-child(6),
.statistics-admin-table th:nth-child(7), .statistics-admin-table td:nth-child(7){width:118px !important;}
.statistics-admin-table th:nth-child(8), .statistics-admin-table td:nth-child(8),
.statistics-admin-table th:nth-child(9), .statistics-admin-table td:nth-child(9){width:88px !important;}
.formula-cell{min-width:320px !important;}
.formula-editor-wrap{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.formula-cell .admin-formula-input{
  min-width: 0 !important;
  width: 100%;
  flex: 1 1 auto;
  font-family: Consolas, Monaco, monospace;
  font-weight: 700;
  color:#1d3324;
}
.admin-formula-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:78px;
  height:34px;
  border-radius:999px !important;
  padding:0 12px !important;
  border:1px solid #d7e3d4 !important;
  background:#f7faf5 !important;
  color:#526058 !important;
  font-size:12px;
  line-height:1;
  font-weight:800;
  box-shadow:none !important;
  cursor:pointer;
}
.admin-formula-btn.is-manual::before{content:'●';font-size:8px;margin-right:6px;color:#a5afa7;}
.admin-formula-btn.is-formula{
  background:#edf8f1 !important;
  border-color:#b7dfc2 !important;
  color:#136c3b !important;
}
.admin-formula-btn.is-formula::before{content:'ƒ';font-size:14px;margin-right:6px;color:#136c3b;font-weight:900;}
.formula-preview-box{font-size:14px;line-height:1.6;}
.formula-preview-box .formula-preview-label{display:block;color:#5b6a60;font-size:12px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:6px;font-family:inherit;}
.formula-preview-box code{display:block;background:#fff;border:1px solid #dbe7d8;border-radius:12px;padding:12px;color:#0f5a32;font-size:16px;}
.formula-preview-box em{color:#526358;font-family:inherit;font-style:normal;font-weight:700;}
.formula-rules-box{
  display:grid;
  grid-template-columns:140px 1fr;
  gap:8px 12px;
  background:#fbfdf9;
  border:1px solid #e1ebde;
  border-radius:14px;
  padding:14px;
  color:#405147;
  font-size:13px;
  line-height:1.45;
}
.formula-rules-box strong{color:#143d25;}
.sc-formula-line{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:-2px;
  margin-bottom:2px;
  font-size:11px;
  color:#0b6335;
  background:#eef8f1;
  border:1px solid #d7eadc;
  border-radius:999px;
  padding:4px 8px;
  width:max-content;
  max-width:100%;
}
.sc-formula-line span{font-weight:900;text-transform:uppercase;letter-spacing:.04em;}
.sc-formula-line code{font-family:Consolas, Monaco, monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px;}
.sc-formula-line--manual{background:#f5f6f2;border-color:#e4e7df;color:#6b746d;}
.stat-legend .sl-formula{background:#eef8f1;color:#0b6335;border:1px solid #d7eadc;}
@media(max-width:1200px){
  .formula-guide-grid{grid-template-columns:1fr 1fr;}
  .formula-cell{min-width:280px !important;}
}
@media(max-width:700px){
  .formula-guide-grid{grid-template-columns:1fr;}
  .formula-rules-box{grid-template-columns:1fr;}
}

/* Formula syntax note additions */
.formula-syntax-note{
  border-color:#e1ecdd;
  background:#fbfdf9;
}
.formula-note-text{
  margin:0 0 14px;
  color:#44564c;
  font-size:12.8px;
  line-height:1.65;
  max-width:1100px;
}
.formula-note-text code,
.formula-example-box code{
  background:#f4f8f1;
  border:1px solid #e2edde;
  border-radius:6px;
  padding:1px 5px;
  color:#245f38;
  font-weight:700;
}
.formula-example-box{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  background:#ffffff;
  border:1px solid #e8f0e5;
  color:#52645a;
  font-size:12px;
  line-height:1.7;
}
.formula-syntax-note .formula-guide-grid > div{
  min-height:auto;
}
.formula-syntax-note .formula-guide-grid code{
  display:inline-block;
  margin:2px 2px 2px 0;
}

/* Final admin header polish + statistics autosave popup */
.admin-top-header {
  background: linear-gradient(135deg, #082f49 0%, #0f5f26 100%);
  color: #fff;
  border-bottom: 0;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
  padding: 14px 22px;
  gap: 16px;
}
.admin-top-header .hdr-brand { display:flex; align-items:center; gap:12px; min-width: 280px; }
.admin-top-header .hdr-icon {
  width:42px; height:42px; display:grid; place-items:center;
  background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.24);
  border-radius:14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.admin-top-header .hdr-title { color:#fff; font-size:18px; font-weight:900; letter-spacing:.01em; }
.admin-top-header .hdr-sub { color:#dcefe1; font-size:12.5px; margin-top:2px; }
.admin-top-header .hdr-right { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; }
.admin-top-header .badge-user,
.admin-top-header .badge-role,
.admin-top-header .btn-hdr {
  border-radius:999px; border:1px solid rgba(255,255,255,.24); color:#fff;
  background:rgba(255,255,255,.12); padding:8px 12px; font-weight:800;
}
.admin-top-header .btn-hdr { text-decoration:none; transition:.15s ease; }
.admin-top-header .btn-hdr:hover { background:rgba(255,255,255,.22); transform:translateY(-1px); }
.admin-top-header .badge-role { background:rgba(215,181,91,.22); }
.stat-save-toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 9999;
  background: #0f5f26; color: #fff; border-radius: 12px; padding: 11px 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,.20); font-weight: 800; font-size: 13px;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease;
}
.stat-save-toast.show { opacity: 1; transform: translateY(0); }
.stat-save-toast.is-error { background: #9E3D2F; }
@media (max-width: 780px) {
  .admin-top-header { align-items:stretch; }
  .admin-top-header .hdr-right { justify-content:flex-start; }
}


.approved-locked {
    background: #f8faf9;
    border-left: 4px solid #2e7d32;
}

.approved-locked input,
.approved-locked select,
.approved-locked textarea {
    background: #f1f5f3 !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
}

.status-approved {
    background: #e8f5ee;
    color: #166534;
    border: 1px solid #bbdfc8;
}

/* Statistics row approval / lock controls */
.statistics-admin-table tr.stat-row-approved {
  background: #f7fbf8;
  box-shadow: inset 4px 0 0 #1f7a3f;
}
.statistics-admin-table tr.stat-row-approved input[readonly] {
  background: #eef5f0 !important;
  color: #506158 !important;
  cursor: not-allowed !important;
}
.stat-approval-cell {
  min-width: 145px;
  text-align: center;
}
.admin-approval-btn {
  border: 1px solid #cfe5d4;
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.admin-approval-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(21, 96, 54, .12);
}
.admin-approval-btn.is-open {
  background: #ecf8ef;
  color: #065f2f;
  border-color: #bfe7ca;
}
.admin-approval-btn.is-approved {
  background: #fff4e8;
  color: #9a4b00;
  border-color: #ffd9ad;
}
.admin-approval-btn:disabled,
.admin-delete-row-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.stat-approval-meta {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.25;
  color: #66756c;
}
.stat-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.stat-lock-badge.is-approved {
  background: #e8f5ee;
  color: #166534;
  border: 1px solid #bbdfc8;
}
.stat-lock-badge.is-open {
  background: #f3f7f4;
  color: #607066;
  border: 1px solid #dce8df;
}

/* Final polish: Statistics row Lock/Cancel buttons + dashboard readonly numeric fields */
.statistics-admin-table .admin-approval-btn {
  width: 100%;
  min-width: 66px;
  border-radius: 11px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  box-shadow: none;
}
.statistics-admin-table .admin-approval-btn.is-open {
  background: #eef9f1 !important;
  color: #066332 !important;
  border: 1px solid #bfe7ca !important;
}
.statistics-admin-table .admin-approval-btn.is-approved {
  background: #fff7ed !important;
  color: #9a4b00 !important;
  border: 1px solid #fed7aa !important;
}
.statistics-admin-table .admin-approval-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(6, 99, 50, .10);
}
.stat-approval-cell { min-width: 92px !important; width: 92px !important; }
.stat-approval-meta {
  margin-top: 5px;
  font-size: 10px !important;
  line-height: 1.18;
  color: #617066;
  word-break: normal;
}
.stat-approval-meta small {
  display: inline-block;
  font-size: 9px;
  line-height: 1.15;
  color: #7b897f;
}
.readonly-stat-box { display:flex; flex-direction:column; gap:6px; }
.stat-readonly {
  background:#f3f6f8 !important;
  border:1px solid #d7dde3 !important;
  color:#4b5563 !important;
  cursor:not-allowed !important;
  opacity:1 !important;
  font-weight:700;
}
.stat-lock-note { font-size:11px; color:#64748b; display:flex; align-items:center; gap:5px; }
.approved .btn-choose:disabled,
.approved .btn-delete-evidence:disabled,
.approved .ev-input:disabled { cursor:not-allowed !important; opacity:.72; }

/* Final fix: Statistics Lock/Cancel buttons soft green style */
.statistics-admin-table .admin-approval-btn,
.statistics-admin-table .admin-approval-btn.is-open,
.statistics-admin-table .admin-approval-btn.is-approved {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 64px !important;
  min-height: 34px !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  background: #eef9f1 !important;
  color: #06723a !important;
  border: 1px solid #bfe7ca !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}
.statistics-admin-table .admin-approval-btn:hover:not(:disabled) {
  background: #e3f6e8 !important;
  color: #045c2e !important;
  border-color: #9edbb0 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(6,114,58,.10) !important;
}
.statistics-admin-table .admin-approval-btn:disabled {
  opacity: .65 !important;
  cursor: not-allowed !important;
}
.stat-approval-meta {
  font-size: 10px !important;
  color: #5f6f64 !important;
}
.stat-approval-meta small {
  font-size: 9px !important;
  color: #7f8d83 !important;
}

/* Final fix: dashboard numeric boxes always locked from Statistics */
input.ans-number.stat-readonly,
input.ans-number.stat-readonly:disabled,
input.ans-number.stat-readonly[readonly] {
  background: #f3f6f8 !important;
  border: 1px solid #d7dde3 !important;
  color: #4b5563 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  font-weight: 700 !important;
}

/* ── Admin header background + backup controls ───────────────────── */
.admin-top-header {
    background: linear-gradient(135deg, #0b3d1c 0%, #145f2c 48%, #2f8b3b 100%) !important;
    color: #fff !important;
    border-bottom: 0 !important;
    box-shadow: 0 10px 28px rgba(15, 95, 38, .18);
}
.admin-top-header .hdr-title,
.admin-top-header .hdr-sub,
.admin-top-header .badge-user,
.admin-top-header .badge-role { color: #fff !important; }
.admin-top-header .hdr-sub { opacity: .88; }
.admin-top-header .hdr-icon {
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.24);
    color: #fff;
}
.admin-top-header .btn-hdr,
.btn-hdr-backup {
    background: rgba(255,255,255,.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.28) !important;
    box-shadow: none !important;
}
.admin-top-header .btn-hdr:hover,
.btn-hdr-backup:hover {
    background: rgba(255,255,255,.24) !important;
}
.admin-export-actions { display:flex; flex-wrap:wrap; gap:10px; }
.admin-backup-link {
    background:#e9f8ee !important;
    color:#0f5f26 !important;
    border-color:#bfe6c8 !important;
    font-weight:900;
}

/* ── POLISHED SAVE ANSWER BUTTONS ───────────────────────────── */
.btn-save-answer,
.save-answer-btn,
button[id^="save_"] {
    width: 100% !important;
    margin-top: 7px !important;
    padding: 6px !important;
    background: #5aab5e !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    transition: background .2s !important;
    display: block !important;
    box-shadow: none !important;
    letter-spacing: normal !important;
    min-width: unset !important;
    min-height: unset !important;
}

.btn-save-answer::before,
.save-answer-btn::before,
button[id^="save_"]::before {
    content: none !important;
    display: none !important;
}

.btn-save-answer:hover,
.save-answer-btn:hover,
button[id^="save_"]:hover {
    background: #3a8c3f !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-save-answer:active,
.save-answer-btn:active,
button[id^="save_"]:active {
    transform: none !important;
    box-shadow: none !important;
}

.btn-save-answer:disabled,
.save-answer-btn:disabled,
button[id^="save_"]:disabled {
    background: #ccc !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-save-answer.is-saving,
.save-answer-btn.is-saving,
button[id^="save_"].is-saving {
    background: #9ca3af !important;
}

.btn-save-answer.is-saved,
.save-answer-btn.is-saved,
button[id^="save_"].is-saved {
    background: #2e7033 !important;
}

.btn-save-answer.is-error,
.save-answer-btn.is-error,
button[id^="save_"].is-error {
    background: #dc2626 !important;
}

.save-answer-note,
.manual-save-note,
div[id^="savenote_"] {
    display: inline-flex !important;
    align-items: center !important;
    margin-top: 7px !important;
    margin-left: 10px !important;
    padding: 5px 10px !important;
    border-radius: 999px !important;
    background: #f3f8f4 !important;
    color: #4b5563 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border: 1px solid #d7eadc !important;
    vertical-align: middle !important;
}

.save-answer-note.note-saving,
.manual-save-note.note-saving,
div[id^="savenote_"].note-saving {
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    border-color: #d1d5db !important;
}

.save-answer-note.note-saved,
.manual-save-note.note-saved,
div[id^="savenote_"].note-saved {
    background: #eaf7ee !important;
    color: #166534 !important;
    border-color: #bfe3c8 !important;
}

.save-answer-note.note-error,
.manual-save-note.note-error,
div[id^="savenote_"].note-error {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}
