:root {
  --forest: #155b5d;
  --forest-dark: #0c4042;
  --leaf: #80b488;
  --leaf-soft: #dcebdc;
  --sky: #47b8dd;
  --sky-soft: #dff3f8;
  --sun: #f1c76d;
  --sun-soft: #fff3ce;
  --cream: #fbf7ec;
  --paper: #fffdf8;
  --ink: #243435;
  --muted: #748080;
  --line: #e5e2d8;
  --coral: #df8975;
  --coral-soft: #f8e3dc;
  --lavender: #e8e4f4;
  --danger: #b84e43;
  --shadow: 0 26px 70px rgba(46, 61, 53, 0.16);
  --shadow-soft: 0 10px 30px rgba(46, 61, 53, 0.08);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(71, 184, 221, 0.38);
  outline-offset: 2px;
}
svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.hidden { display: none !important; }

/* Login */
.login-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 28px 18px;
  background: linear-gradient(150deg, #f8eed8 0%, #e5f0e8 58%, #dff3f8 100%);
}
.login-art { position: absolute; inset: 0; pointer-events: none; }
.login-art span { position: absolute; border-radius: 46% 54% 60% 40% / 42% 45% 55% 58%; opacity: 0.72; }
.login-art span:nth-child(1) { width: 330px; height: 330px; top: -120px; left: -110px; background: var(--leaf-soft); transform: rotate(-11deg); }
.login-art span:nth-child(2) { width: 240px; height: 240px; right: -65px; bottom: -55px; background: var(--sun-soft); transform: rotate(22deg); }
.login-art span:nth-child(3) { width: 115px; height: 115px; top: 16%; right: 12%; background: var(--sky-soft); transform: rotate(-18deg); }
.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid rgba(229, 226, 216, 0.9);
  border-radius: 32px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.login-logo { position: relative; display: grid; height: 150px; place-items: center; margin: -4px 0 8px; }
.login-logo::before { position: absolute; width: 142px; height: 142px; border-radius: 46% 54% 60% 40% / 42% 45% 55% 58%; background: var(--leaf-soft); content: ""; transform: rotate(-9deg); }
.login-logo img { position: relative; width: 220px; max-height: 150px; object-fit: contain; mix-blend-mode: multiply; }
.login-kicker { margin: 0 0 8px; color: var(--forest); font-size: 10px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.login-card h1 { margin: 0; color: var(--forest-dark); font-size: clamp(35px, 9vw, 47px); letter-spacing: -0.055em; line-height: 1; }
.login-intro { margin: 12px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.form-stack { display: grid; gap: 11px; }
.field-shell { display: block; padding: 7px 14px 5px; border: 1px solid var(--line); border-radius: 17px; background: #fff; transition: border-color 160ms ease, box-shadow 160ms ease; }
.field-shell:focus-within { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(71, 184, 221, 0.12); }
.field-shell > span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase; }
.field-shell input { width: 100%; height: 38px; padding: 0; border: 0; outline: 0; background: transparent; font-weight: 750; }
.primary-button, .secondary-button, .danger-button, .mini-button {
  border: 0;
  border-radius: 14px;
  font-weight: 850;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease;
}
.primary-button { min-height: 48px; padding: 0 17px; color: #fff; background: var(--forest); box-shadow: 0 7px 0 var(--forest-dark); }
.primary-button:hover { background: #176668; }
.primary-button:active { box-shadow: 0 3px 0 var(--forest-dark); transform: translateY(4px); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: 0.58; }
.secondary-button { min-height: 42px; padding: 0 14px; color: var(--forest-dark); background: var(--leaf-soft); }
.secondary-button:hover { background: #cee4d0; }
.secondary-button:active, .danger-button:active, .mini-button:active { transform: scale(0.97); }
.danger-button { min-height: 42px; padding: 0 14px; color: #fff; background: var(--danger); }
.mini-button { min-height: 34px; padding: 0 11px; color: var(--forest-dark); background: var(--sun-soft); font-size: 10px; }
.text-button { border: 0; color: var(--forest); background: transparent; font-size: 11px; font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.login-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 21px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 12px; color: #803b34; background: var(--coral-soft); font-size: 11px; line-height: 1.45; }
.privacy-strip { display: grid; gap: 3px; margin-top: 23px; padding: 13px; border-radius: 15px; color: #37613d; background: var(--leaf-soft); font-size: 10px; line-height: 1.45; }

/* App frame and topbar */
.app-shell { min-height: 100vh; }
.main { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(229, 226, 216, 0.8);
  background: var(--paper, #fbf7ec);
  box-shadow: 0 6px 18px rgba(21, 91, 93, 0.06);
}
.menu-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  transition: transform 140ms var(--ease-out), border-color 160ms ease;
}
.menu-button:hover { border-color: #c9c7bd; }
.menu-button:active { transform: scale(0.95); }
.menu-button span { width: 18px; height: 2px; border-radius: 2px; background: var(--forest); }
.mobile-brand { display: grid; width: 44px; height: 44px; place-items: center; overflow: hidden; border-radius: 15px; background: var(--leaf-soft); }
.mobile-brand img { width: 42px; height: 42px; object-fit: contain; mix-blend-mode: multiply; }
.topbar-context span, .topbar-context strong { display: block; }
.topbar-context span { margin-bottom: 2px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.topbar-context strong { color: var(--forest-dark); font-size: 13px; }
.account-chip { display: flex; min-height: 48px; align-items: center; gap: 9px; margin-left: auto; padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); transition: transform 140ms var(--ease-out), box-shadow 160ms ease; }
.account-chip:hover { box-shadow: var(--shadow-soft); }
.account-chip:active { transform: scale(0.97); }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; color: #fff; background: var(--forest); font-size: 10px; font-weight: 900; }
.account-copy { min-width: 88px; text-align: left; }
.account-copy strong, .account-copy small { display: block; }
.account-copy strong { font-size: 10px; }
.account-copy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.account-chip > svg { width: 15px; color: var(--muted); }

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 45, 43, 0.34);
  opacity: 0;
  transition: opacity 190ms ease;
  backdrop-filter: blur(3px);
}
.drawer-backdrop[hidden] { display: none; }
.drawer-backdrop.open { opacity: 1; }
.sidebar {
  display: flex;
  width: min(86vw, 330px);
  height: 100%;
  flex-direction: column;
  padding: 22px 18px;
  border-radius: 0 28px 28px 0;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateX(-102%);
  transition: transform 260ms var(--ease-out);
}
.drawer-backdrop.open .sidebar { transform: translateX(0); }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 46px; height: 46px; place-items: center; overflow: hidden; border-radius: 15px; background: var(--leaf-soft); }
.brand-mark img { width: 44px; height: 44px; object-fit: contain; mix-blend-mode: multiply; }
.brand strong, .brand small { display: block; }
.brand strong { color: var(--forest-dark); font-size: 13px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.icon-button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--forest-dark); background: var(--paper); font-size: 24px; line-height: 1; transition: transform 140ms var(--ease-out), background-color 160ms ease; }
.icon-button:hover { background: var(--leaf-soft); }
.icon-button:active { transform: scale(0.94); }
.side-nav { display: grid; gap: 6px; margin-top: 34px; }
.nav-item { display: grid; min-height: 50px; grid-template-columns: 23px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 0 13px; border: 0; border-radius: 15px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; text-align: left; text-decoration: none; transition: color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out); }
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover, .nav-item.active { color: var(--forest-dark); background: var(--leaf-soft); }
.nav-item:active { transform: scale(0.98); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); }
.sidebar-note { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 14px; border-radius: 16px; background: var(--sky-soft); }
.live-dot { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px rgba(71, 184, 221, 0.16); }
.sidebar-note strong { display: block; color: #18566a; font-size: 10px; }
.sidebar-note p { margin: 3px 0 0; color: #52747c; font-size: 9px; line-height: 1.45; }
body.demo-mode .sidebar-note { background: var(--sun-soft); }
body.demo-mode .live-dot { background: var(--sun); box-shadow: 0 0 0 4px rgba(241, 199, 109, 0.2); }

/* Dashboard */
.page-grid { display: grid; max-width: 1280px; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 48px) 54px; }
.primary-column { min-width: 0; }
.hero { position: relative; display: grid; min-height: 270px; grid-template-columns: minmax(0, 1fr) 220px; align-items: end; gap: 30px; overflow: hidden; padding: clamp(27px, 4vw, 43px); border-radius: 31px; color: #fff; background: var(--forest); box-shadow: 0 16px 36px rgba(21, 91, 93, 0.2); }
.hero::before { position: absolute; width: 220px; height: 220px; right: -75px; bottom: -115px; border-radius: 50%; background: rgba(71, 184, 221, 0.24); content: ""; }
.hero::after { position: absolute; width: 110px; height: 110px; top: -35px; right: 31%; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 48% 52% 57% 43%; content: ""; transform: rotate(18deg); }
.hero-copy, .role-card { position: relative; z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: rgba(255, 255, 255, 0.72); font-size: 9px; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase; }
.eyebrow span { width: 20px; height: 2px; border-radius: 2px; background: var(--sun); }
.hero h1 { margin: 0; font-size: clamp(38px, 5vw, 60px); letter-spacing: -0.06em; line-height: 0.96; }
.hero h1 em { color: #b8dcbc; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.hero-copy > p { max-width: 590px; margin: 20px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 12px; line-height: 1.65; }
.role-card { align-self: stretch; padding: 15px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 20px; background: rgba(255, 255, 255, 0.09); backdrop-filter: blur(10px); }
.role-card-head { display: flex; align-items: center; justify-content: space-between; color: rgba(255, 255, 255, 0.7); font-size: 9px; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.preview-label { padding: 5px 7px; border-radius: 999px; color: #4c3a13; background: var(--sun); font-size: 8px; }
.role-summary { display: grid; gap: 4px; margin-top: 28px; }
.role-summary strong { font-size: 19px; letter-spacing: -0.03em; }
.role-summary span { color: rgba(255, 255, 255, 0.62); font-size: 10px; }
.role-card > p { margin: 14px 0 0; color: rgba(255, 255, 255, 0.66); font-size: 10px; line-height: 1.5; }
.mode-banner { display: flex; align-items: center; gap: 11px; margin-top: 13px; padding: 12px 14px; border-radius: 17px; background: var(--paper); box-shadow: var(--shadow-soft); }
.mode-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--forest); background: var(--leaf-soft); }
.mode-icon svg { width: 18px; height: 18px; }
.mode-banner > div { min-width: 0; }
.mode-banner strong { display: block; color: var(--forest-dark); font-size: 10px; }
.mode-banner p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.mode-badge { margin-left: auto; padding: 6px 9px; border-radius: 999px; color: var(--forest-dark); background: var(--leaf-soft); font-size: 8px; font-weight: 900; }
body[data-role="KOORDINATOR"] .mode-icon, body[data-role="KOORDINATOR"] .mode-badge { color: #18566a; background: var(--sky-soft); }
body.demo-mode .mode-banner { background: var(--sun-soft); }
.status-section, .services-section { margin-top: 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.section-kicker { display: block; margin-bottom: 4px; color: var(--forest); font-size: 8px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.section-heading h2 { margin: 0; color: var(--forest-dark); font-size: 19px; letter-spacing: -0.035em; }
.quiet-pill { padding: 6px 9px; border-radius: 999px; color: var(--muted); background: var(--paper); font-size: 8px; font-weight: 800; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.status-card { display: flex; min-height: 145px; flex-direction: column; align-items: flex-start; padding: 15px; border: 0; border-radius: 21px; background: var(--paper); text-align: left; transition: transform 160ms var(--ease-out), box-shadow 170ms ease; }
.status-card:nth-child(1) { background: var(--leaf-soft); }
.status-card:nth-child(2) { background: var(--sky-soft); }
.status-card:nth-child(3) { background: var(--sun-soft); }
.status-card:nth-child(4) { background: var(--coral-soft); }
.status-card:hover { box-shadow: var(--shadow-soft); transform: translateY(-2px) rotate(-0.3deg); }
.status-card:active { transform: scale(0.98); }
.card-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; color: var(--forest); background: rgba(255, 255, 255, 0.7); }
.card-icon svg { width: 19px; }
.card-meta { min-width: 0; margin-top: 13px; }
.card-meta span, .card-meta strong { display: block; }
.card-meta span { margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.card-meta strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.empty-state { margin-top: auto; padding-top: 10px; color: var(--muted); font-size: 8px; font-weight: 750; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.service-card { display: grid; min-height: 142px; grid-template-columns: 1fr auto; grid-template-rows: 42px minmax(45px, auto) auto; align-items: start; gap: 8px; padding: 14px; border: 0; border-radius: 22px; color: var(--ink); background: var(--paper); text-align: left; transition: transform 170ms var(--ease-out), box-shadow 170ms ease; }
.service-card:nth-child(1) { background: var(--leaf-soft); }
.service-card:nth-child(2) { background: var(--sky-soft); }
.service-card:nth-child(3) { background: var(--sun-soft); }
.service-card:nth-child(4) { background: var(--lavender); }
.service-card:nth-child(5) { background: var(--coral-soft); }
.service-card:nth-child(6) { background: #e2ecea; }
.service-card:hover { box-shadow: var(--shadow-soft); transform: translateY(-3px) rotate(-0.5deg); }
.service-card:active { transform: scale(0.98); }
.service-icon { display: grid; width: 42px; height: 42px; grid-column: 1; place-items: center; border-radius: 13px; color: var(--forest); background: rgba(255, 255, 255, 0.72); }
.service-icon svg { width: 20px; }
.service-copy { min-width: 0; grid-column: 1 / -1; }
.service-copy strong, .service-copy small { display: block; }
.service-copy strong { font-size: 11px; }
.service-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.stage-pill { grid-column: 1; justify-self: start; padding: 5px 8px; border-radius: 999px; color: var(--forest-dark); background: rgba(255, 255, 255, 0.64); font-size: 8px; font-weight: 900; }
.arrow { width: 16px; grid-column: 2; grid-row: 1; align-self: center; color: var(--forest); transition: transform 170ms var(--ease-out); }
.service-card:hover .arrow { transform: translateX(3px); }
.roadmap { position: sticky; top: 98px; align-self: start; padding: 20px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow-soft); }
.roadmap-head { display: flex; align-items: center; gap: 11px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.roadmap-number { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; color: #fff; background: var(--forest); font-size: 11px; font-weight: 900; }
.roadmap-head span:not(.roadmap-number) { display: block; margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.roadmap-head h2 { margin: 0; color: var(--forest-dark); font-size: 14px; }
.roadmap-intro { margin: 16px 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.community-list { display: grid; gap: 15px; margin: 0; padding: 0; list-style: none; }
.community-list li { display: grid; grid-template-columns: 11px minmax(0, 1fr); gap: 10px; align-items: start; }
.community-dot { width: 10px; height: 10px; margin-top: 3px; border-radius: 50%; }
.community-dot.leaf { background: var(--leaf); }
.community-dot.sky { background: var(--sky); }
.community-dot.sun { background: var(--sun); }
.community-list strong, .community-list small { display: block; }
.community-list strong { font-size: 9px; }
.community-list small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.privacy-note { display: flex; gap: 9px; margin-top: 18px; padding: 13px; border-radius: 15px; color: #37613d; background: var(--leaf-soft); }
.privacy-note svg { width: 18px; flex: 0 0 auto; }
.privacy-note p { margin: 0; font-size: 8px; line-height: 1.45; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { margin-bottom: 3px; font-size: 9px; }

/* Feature dialog and generated content */
.feature-dialog { width: min(780px, calc(100vw - 30px)); max-height: min(88vh, 900px); padding: 0; overflow: hidden; border: 0; border-radius: 28px; background: var(--cream); box-shadow: var(--shadow); }
.feature-dialog::backdrop { background: rgba(20, 45, 43, 0.42); backdrop-filter: blur(4px); }
.feature-dialog[open] { animation: dialog-in 220ms var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dialog-shell { display: flex; max-height: min(88vh, 900px); flex-direction: column; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; color: #fff; background: var(--forest); }
.dialog-header span:not(.icon-button span) { display: block; margin-bottom: 4px; color: rgba(255, 255, 255, 0.67); font-size: 8px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.dialog-header h2 { margin: 0; font-size: 22px; letter-spacing: -0.04em; }
.dialog-header .icon-button { border-color: rgba(255, 255, 255, 0.16); color: #fff; background: rgba(255, 255, 255, 0.1); }
.dialog-body { min-height: 220px; overflow-y: auto; padding: 18px 20px 25px; }
.feature-layout { display: grid; gap: 13px; }
.feature-panel { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.feature-panel.tint-leaf { border: 0; background: var(--leaf-soft); }
.feature-panel.tint-sky { border: 0; background: var(--sky-soft); }
.feature-panel.tint-sun { border: 0; background: var(--sun-soft); }
.feature-panel.tint-coral { border: 0; background: var(--coral-soft); }
.panel-kicker { margin: 0 0 7px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.panel-value { margin: 0; color: var(--forest-dark); font-size: 24px; letter-spacing: -0.04em; }
.panel-copy { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.data-list { display: grid; gap: 8px; }
.data-card { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.data-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.data-card h3 { margin: 0; color: var(--forest-dark); font-size: 12px; }
.data-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.data-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 8px; }
.status-badge { display: inline-flex; width: fit-content; align-items: center; padding: 5px 8px; border-radius: 999px; color: var(--forest-dark); background: var(--leaf-soft); font-size: 8px; font-weight: 900; white-space: nowrap; }
.status-badge.warn { color: #6e5017; background: var(--sun-soft); }
.status-badge.cancel { color: #843b34; background: var(--coral-soft); }
.empty-panel { padding: 28px 18px; border: 1px dashed #d3d0c5; border-radius: 19px; color: var(--muted); background: rgba(255, 253, 248, 0.62); text-align: center; }
.empty-panel strong { display: block; margin-bottom: 6px; color: var(--forest-dark); font-size: 12px; }
.empty-panel span { font-size: 9px; line-height: 1.5; }
.coordinator-panel { margin-top: 16px; padding: 16px; border-radius: 20px; background: var(--sky-soft); }
.coordinator-panel > h3 { margin: 0 0 5px; color: #18566a; font-size: 13px; }
.coordinator-panel > p { margin: 0 0 15px; color: #52747c; font-size: 9px; line-height: 1.5; }
.feature-form { display: grid; gap: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 0.05em; text-transform: uppercase; }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: #fff; font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.field textarea { min-height: 95px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(71, 184, 221, 0.12); }
.check-field { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; color: var(--muted); font-size: 9px; line-height: 1.45; }
.check-field input { width: 16px; height: 16px; margin: 0; accent-color: var(--forest); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-control { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.inline-control select { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 9px; }
.payment-card { padding: 19px; border-radius: 22px; color: #fff; background: var(--forest); }
.payment-card span, .payment-card strong { display: block; }
.payment-card > span { color: rgba(255, 255, 255, 0.66); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.payment-card strong { margin: 10px 0 4px; font-size: clamp(23px, 6vw, 35px); letter-spacing: 0.04em; }
.payment-card small { color: rgba(255, 255, 255, 0.7); font-size: 9px; }
.warning-note { padding: 12px; border-radius: 14px; color: #6e5017; background: var(--sun-soft); font-size: 9px; line-height: 1.5; }
.privacy-callout { display: flex; gap: 10px; padding: 13px; border-radius: 15px; color: #37613d; background: var(--leaf-soft); font-size: 9px; line-height: 1.5; }
.privacy-callout svg { width: 18px; flex: 0 0 auto; }
.qr-card { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; border-radius: 18px; background: var(--paper); }
.qr-wrap { padding: 9px; border-radius: 14px; background: #fff; }
.qr-wrap svg { width: 100%; height: auto; }
.qr-copy strong { display: block; color: var(--forest-dark); font-size: 20px; letter-spacing: 0.08em; }
.qr-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.turnstile-slot { min-height: 1px; }

/* Loading and toast */
.loading-layer { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--forest-dark); background: rgba(251, 247, 236, 0.78); font-size: 10px; font-weight: 850; backdrop-filter: blur(5px); }
.loader { width: 34px; height: 34px; border: 4px solid var(--leaf-soft); border-top-color: var(--forest); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; max-width: min(390px, calc(100vw - 30px)); align-items: center; gap: 9px; padding: 11px 14px 11px 10px; border-radius: 999px; color: #fff; background: var(--forest-dark); box-shadow: var(--shadow); font-size: 10px; font-weight: 800; opacity: 0; pointer-events: none; transform: translateY(13px) scale(0.98); transition: opacity 180ms ease, transform 220ms var(--ease-out); }
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: var(--forest-dark); background: var(--sun); font-family: Georgia, serif; font-size: 13px; }

@media (max-width: 1050px) {
  .page-grid { grid-template-columns: 1fr; }
  .roadmap { position: static; }
  .community-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar { min-height: 68px; padding: 9px 14px; }
  .topbar-context span { display: none; }
  .mobile-brand { display: none; }
  .account-chip { min-height: 42px; border: 0; background: transparent; }
  .account-copy, .account-chip > svg { display: none; }
  .avatar { width: 38px; height: 38px; }
  .page-grid { padding: 18px 14px 34px; }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 25px; padding: 27px 21px 21px; border-radius: 26px; }
  .hero h1 { font-size: clamp(38px, 12vw, 50px); }
  .role-card { padding: 13px; }
  .role-summary { margin-top: 17px; }
  .mode-banner { align-items: flex-start; }
  .mode-badge { display: none; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .status-card { min-height: 136px; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .service-card { min-height: 148px; }
  .section-heading { align-items: center; }
  .quiet-pill { display: none; }
  .community-list { grid-template-columns: 1fr; }
  .feature-dialog { width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .dialog-shell { max-height: 92vh; }
  .dialog-body { padding: 15px 14px calc(22px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .qr-card { grid-template-columns: 105px minmax(0, 1fr); }
  .toast { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); left: 14px; justify-content: center; max-width: none; border-radius: 15px; }
}

@media (max-width: 380px) {
  .login-card { padding: 25px 19px; border-radius: 25px; }
  .status-grid, .service-grid { grid-template-columns: 1fr; }
  .status-card { min-height: 100px; display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 0 11px; }
  .status-card .card-meta { margin-top: 0; }
  .status-card .empty-state { grid-column: 2; margin-top: 3px; padding: 0; }
  .service-card { min-height: 104px; grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; }
  .service-icon { grid-row: 1 / 3; }
  .service-copy { grid-column: 2; }
  .stage-pill { grid-column: 2; }
  .arrow { grid-column: 3; grid-row: 1 / 3; }
  .qr-card { grid-template-columns: 1fr; text-align: center; }
  .qr-wrap { width: 150px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== IPL hero card ===== */
.ipl-hero-card { margin-top: 20px; padding: 20px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow-soft); border: 1px solid var(--line); }
.ipl-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ipl-hero-kicker { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.ipl-hero-pill { padding: 5px 11px; border-radius: 999px; font-size: 10px; font-weight: 900; color: #2f5417; background: var(--leaf-soft); }
.ipl-hero-status { display: block; margin: 12px 0 2px; color: var(--forest-dark); font-size: 30px; letter-spacing: -0.04em; }
.ipl-hero-meta { margin: 0; color: var(--muted); font-size: 11px; }
.ipl-hero-action { margin-top: 15px; padding: 10px 15px; border: 0; border-radius: 13px; color: #fff; background: var(--forest); font-size: 11px; font-weight: 800; cursor: pointer; transition: transform 140ms var(--ease-out), background 160ms ease; }
.ipl-hero-action:active { transform: scale(0.97); }
.ipl-hero-card[data-status="LUNAS"] { border-color: rgba(124, 179, 66, 0.4); }
.ipl-hero-card[data-status="LUNAS"] .ipl-hero-pill { color: #2f5417; background: var(--leaf-soft); }
.ipl-hero-card[data-status="BELUM_BAYAR"] { border-color: rgba(224, 93, 75, 0.4); }
.ipl-hero-card[data-status="BELUM_BAYAR"] .ipl-hero-pill { color: #7f1d1d; background: #fbe0dc; }
.ipl-hero-card[data-status="BELUM_BAYAR"] .ipl-hero-status { color: #9a3a2c; }
.ipl-hero-card[data-status="MENUNGGU_VERIFIKASI"] .ipl-hero-pill { color: #7a5a12; background: var(--sun-soft); }

/* ===== Kas & Keuangan ===== */
.kas-section { margin-top: 30px; }
.kas-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.kas-stat { padding: 13px; border-radius: 17px; background: var(--paper); box-shadow: var(--shadow-soft); }
.kas-stat span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.kas-stat strong { color: var(--forest-dark); font-size: 15px; letter-spacing: -0.02em; }
.kas-balance strong { color: var(--forest); }
.kas-in strong { color: #3f6b1f; }
.kas-out strong { color: #c0392b; }
.kas-chart-wrap { padding: 16px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow-soft); }
.kas-legend { display: flex; gap: 16px; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.kas-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kas-legend .dot { width: 10px; height: 10px; border-radius: 3px; }
.dot-in { background: #7cb342; }
.dot-out { background: #e05d4b; }
.kas-chart { width: 100%; }
.kas-chart canvas { display: block; width: 100% !important; height: 200px !important; }
@media (max-width: 620px) {
  .kas-summary { grid-template-columns: 1fr; }
  .ipl-hero-status { font-size: 26px; }
}
