:root {
  --navy: #002155;      /* PHG Blue - primary */
  --navy-hover: #001640;
  --blue: #0178C8;      /* SDH Blue - accent */
  --blue-hover: #0163a5;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e2e6ee;
  --text: #14213d;
  --text-muted: #647089;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 33, 85, 0.06), 0 4px 12px rgba(0, 33, 85, 0.06);
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
}
.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
/* Official inverted (white) horizontal logo — never recolored, never re-backgrounded */
.brand-logo { height: 30px; width: auto; }
.brand-tag {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

/* ---------- Layout ---------- */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.hero { margin-bottom: 32px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}
.subtitle { color: var(--text-muted); margin: 0; max-width: 60ch; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

/* ---------- Dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--blue);
  background: #eef7fd;
}
.dropzone-icon { width: 32px; height: 32px; color: var(--text-muted); }
.dropzone-text { color: var(--text-muted); }
.dropzone .link { color: var(--blue); font-weight: 600; }
.file-name { font-weight: 600; color: var(--text); }

/* ---------- Buttons (pill, SDH CTA style) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; margin-top: 16px; width: 100%; }
.btn-primary:not(:disabled):hover { background: var(--navy-hover); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:not(:disabled):hover { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); }

/* Download-template call-to-action, above the dropzone */
.template-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: #eef7fd;
  border: 1px solid #bfe1f7;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
}
.template-banner-icon {
  width: 32px;
  height: 32px;
  color: var(--blue);
  flex-shrink: 0;
}
.template-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.template-banner-text strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--navy);
}
.template-banner-text span { font-size: 13px; color: var(--text-muted); }
.template-banner-btn {
  margin-top: 0;
  width: auto;
  flex-shrink: 0;
  text-decoration: none;
}
@media (max-width: 560px) {
  .template-banner { flex-wrap: wrap; }
  .template-banner-btn { width: 100%; }
}

.error-msg {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  font-size: 14px;
}

/* ---------- Loading ---------- */
[hidden] { display: none !important; }
#loading-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  color: var(--text-muted);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Results summary ---------- */
.summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 3px solid var(--blue);
}
.summary-stats { display: flex; gap: 28px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; }
.stat-num { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-warn .stat-num { color: var(--warn); }
.stat-info .stat-num { color: var(--info); }
.summary-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-actions .btn-primary { margin-top: 0; width: auto; }

.report-card summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
}
.report-list { margin: 12px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-muted); }
.report-list li { margin-bottom: 4px; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1194 / 313;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.gallery-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gallery-item-name {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-item-footer a {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  flex-shrink: 0;
}
.gallery-item-footer a:hover { text-decoration: underline; }

/* ---------- Footer / supergraphic (open-book, right-dip) ---------- */
.site-footer { margin-top: 40px; }
.wave-divider {
  display: block;
  width: 100%;
  height: 48px;
  margin-bottom: -1px;
}
.site-footer-band {
  position: relative;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  padding: 18px 24px 22px;
  display: flex;
  align-items: center;
  min-height: 56px;
}
.footer-note { max-width: 60%; }
/* Pelita Harapan Group endorsement card — bottom-right, under the notch (per A4 letterhead) */
.footer-endorse {
  position: absolute;
  right: 24px;
  bottom: 0;
  height: 74px;
  width: auto;
}

/* ---------- Header brand link (logo → dashboard home) ---------- */
.brand-link { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Breadcrumb (tool pages) ---------- */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--blue); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; color: var(--border); }

/* ---------- Dashboard tool grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 4px rgba(0, 33, 85, 0.08), 0 10px 24px rgba(0, 33, 85, 0.12);
  transform: translateY(-2px);
}
.tool-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eef7fd;
  color: var(--blue);
}
.tool-icon svg { width: 26px; height: 26px; }
.tool-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.tool-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}
.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}
.tool-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s;
}
.tool-card:hover .tool-cta svg { transform: translateX(3px); }

/* ---------- Header user / sign-out ---------- */
.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-user-name {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}
.header-logout {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  transition: background-color 0.15s, border-color 0.15s;
}
.header-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.6);
}

/* ---------- Login page ---------- */
.login-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 24px 96px;
  display: flex;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--blue);
  padding: 40px 32px;
  text-align: center;
}
.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #eef7fd;
  color: var(--blue);
  margin-bottom: 20px;
}
.login-icon svg { width: 28px; height: 28px; }
.login-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}
.login-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}
.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 20px;
  text-align: left;
}
/* Microsoft sign-in button: neutral white, Microsoft's own brand mark (never recolored) */
.btn-ms {
  width: 100%;
  background: #fff;
  color: #2b2b2b;
  border-color: var(--border);
  gap: 10px;
}
.btn-ms:hover { background: #f4f6fa; border-color: #c8d0de; }
.ms-logo { width: 18px; height: 18px; flex-shrink: 0; }
.login-note {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
