:root {
  --green: #176b4d;
  --green2: #21845e;
  --green-dark: #103f31;
  --mint: #eaf5ef;
  --ink: #20332b;
  --muted: #65736c;
  --line: #e2eae5;
  --bg: #f7faf8;
  --white: #ffffff;
  --gold: #e5b84b;
  --amber-bg: #fff8e7;
  --amber-line: #f0dfb7;
  --amber-ink: #6b5729;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --info: #175cd3;
  --info-bg: #eff8ff;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.wrap {
  width: min(1140px, 92%);
  margin: auto;
}

/* Header & Navigation */
header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  color: var(--green);
}

.seal {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 3px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.profile-logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
  background: var(--white);
  padding: 8px;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(16, 63, 49, 0.14);
}

.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  font-weight: 600;
}

.links a {
  padding: 6px 2px;
  transition: color 0.15s ease;
}

.links a:hover {
  color: var(--green2);
}

.nav-admin {
  background: var(--mint);
  color: var(--green);
  padding: 8px 13px !important;
  border-radius: 10px;
  font-weight: 700;
}

.nav-admin:hover {
  background: #d8ecdf;
}

.menu {
  display: none;
  border: 0;
  background: var(--mint);
  color: var(--green);
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 68px 0 58px;
  background:
    radial-gradient(circle at 85% 20%, rgba(229, 184, 75, 0.2), transparent 42%),
    radial-gradient(circle at 12% 85%, rgba(255, 255, 255, 0.1), transparent 36%),
    linear-gradient(120deg, #0e3a2d, #176b4d 58%, #21845e);
  color: var(--white);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 30px;
  font-size: 12px;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(34px, 4.8vw, 54px);
  line-height: 1.09;
  margin: 18px 0 16px;
}

.hero p {
  max-width: 610px;
  color: #e2f0e8;
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--gold);
  color: #263322;
}

.btn.outline {
  border: 1px solid rgba(255, 255, 255, 0.52);
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.btn.green {
  background: var(--green);
  color: var(--white);
}

.btn.soft-btn {
  background: var(--mint);
  color: var(--green);
}

.btn.danger-btn {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecdca;
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 22px;
  backdrop-filter: blur(8px);
}

.hero-card strong {
  font-size: 18px;
}

.hero-card p {
  font-size: 13px;
  margin: 6px 0 0;
}

.hero-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.hero-stat div {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 13px;
}

.hero-stat b {
  display: block;
  font-size: 22px;
  line-height: 1.15;
}

.hero-stat span {
  font-size: 11px;
  color: #d9e9e0;
}

/* Sections */
section {
  padding: 64px 0;
}

.soft {
  background: #eef5f0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 26px;
}

.kicker {
  color: var(--green2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 5px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.section-head p {
  max-width: 490px;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 5px 20px rgba(29, 73, 48, 0.04);
}

.icon {
  width: 44px;
  height: 44px;
  background: var(--mint);
  color: var(--green);
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 21px;
}

.card h3 {
  font-size: 16px;
  margin: 14px 0 6px;
}

.card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.service {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 19px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(29, 73, 48, 0.03);
}

.service b {
  display: block;
  font-size: 15px;
  margin: 10px 0 5px;
}

.service span {
  font-size: 12.5px;
  color: var(--muted);
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green2);
  font-size: 12.5px;
  font-weight: 800;
  margin-top: 14px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.more:hover {
  text-decoration: underline;
}

.notice {
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--amber-ink);
  font-size: 12.5px;
  margin-top: 20px;
}

/* Tracking Panel */
.track-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 6px 24px rgba(29, 73, 48, 0.05);
}

.track-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.track-form input {
  flex: 1;
  min-width: 220px;
  border: 1px solid #d2dfd7;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
}

.sample-codes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.code-pill {
  background: var(--mint);
  color: var(--green);
  border: 1px solid #cde4d6;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.track-result {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.track-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.meta-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
}

.meta-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.meta-item strong {
  font-size: 13.5px;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 750;
}

.badge.Menunggu,
.badge.Diterima {
  background: var(--amber-bg);
  color: var(--amber-ink);
}

.badge.Diproses,
.badge.Ditindaklanjuti {
  background: var(--info-bg);
  color: var(--info);
}

.badge.Selesai {
  background: var(--mint);
  color: var(--green);
}

.badge.Ditolak {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Tabs & Filters */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 30px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

/* Profile */
.profile-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
  align-items: start;
}

.profile-art {
  min-height: 290px;
  border-radius: 20px;
  background: linear-gradient(135deg, #d8ecdf, #9fc9ad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.profile-art .emoji {
  font-size: 72px;
}

.profile-art p {
  margin: 10px 0 0;
  font-size: 13px;
  color: #164433;
  font-weight: 600;
}

.list-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* News & Potentials */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.news {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-img {
  height: 145px;
  background: linear-gradient(135deg, #cfe4d6, #8bb99d);
  display: grid;
  place-items: center;
  font-size: 42px;
}

.news-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.news small {
  color: var(--green2);
  font-weight: 800;
  font-size: 11px;
}

.news h3 {
  font-size: 15.5px;
  margin: 7px 0;
}

.news p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}

.tag {
  display: inline-block;
  margin-top: 10px;
  background: var(--mint);
  color: var(--green);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

/* Footer */
footer {
  background: #123d30;
  color: #e9f3ed;
  padding: 44px 0 22px;
}

.foot {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 30px;
}

.foot p,
.foot a {
  font-size: 12.5px;
  color: #c5d9ce;
}

.foot h3 {
  font-size: 14px;
  margin-top: 0;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 30px;
  padding-top: 17px;
  font-size: 11.5px;
  color: #b9d0c4;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 37, 29, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 60;
}

.modal.show {
  display: flex;
}

.dialog {
  background: var(--white);
  border-radius: 18px;
  padding: 24px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dialog h2 {
  font-size: 20px;
  margin: 0;
}

.close {
  border: 0;
  background: #eef5f0;
  border-radius: 9px;
  padding: 7px 11px;
  cursor: pointer;
  font-weight: 700;
}

.field {
  margin: 12px 0;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d7e2db;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13.5px;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.form-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
}

.success-box {
  background: var(--mint);
  border: 1px solid #b9dfc8;
  border-radius: 12px;
  padding: 16px;
}

.error-box {
  background: var(--danger-bg);
  border: 1px solid #fecdca;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12.5px;
  margin-top: 10px;
}

.req-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg);
}

.req-card ul {
  margin: 8px 0 6px;
  padding-left: 18px;
  font-size: 13px;
}

/* Admin Specific */
.admin-shell {
  padding: 34px 0 60px;
}

.admin-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #f2f7f4;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.inline-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 240px;
}

.inline-controls select,
.inline-controls input {
  border: 1px solid #d7e2db;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12.5px;
}

.inline-controls input {
  flex: 1;
  min-width: 150px;
}

td:first-child strong {
  white-space: nowrap;
}

/* Multi-photo Uploader & Galleries */
.photo-uploader {
  border: 1px dashed #b9d3c3;
  background: #f5faf7;
  border-radius: 12px;
  padding: 12px;
}

.photo-upload-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.photo-upload-bar input[type="file"] {
  font-size: 12px;
  border: 0;
  padding: 0;
  width: auto;
  max-width: 100%;
}

.photo-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
  background: var(--mint);
  padding: 4px 9px;
  border-radius: 20px;
}

.photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.photo-thumb {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 1 / 1;
  background: #e5efe9;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(16, 37, 29, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.photo-edit-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cde4d6;
  border-radius: 12px;
  background: #f8fcfa;
}

.news-img {
  position: relative;
  height: 155px;
  flex-shrink: 0;
  overflow: hidden;
}

.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pot-cover {
  position: relative;
  height: 145px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #cfe4d6, #8bb99d);
}

.photo-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(16, 37, 29, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
}

.gallery-box {
  margin: 12px 0 16px;
}

.gallery-main {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #eaf2ed;
  aspect-ratio: 16 / 10;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(16, 37, 29, 0.72);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

.gallery-caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(16, 37, 29, 0.75);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 8px;
}

.gallery-thumb-btn {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  width: 60px;
  height: 46px;
  flex-shrink: 0;
  cursor: pointer;
  background: #eaf2ed;
}

.gallery-thumb-btn.active {
  border-color: var(--green);
}

.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hierarchical Gov Org Chart, Dusun & Welfare */
.org-chart {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: 0 6px 24px rgba(29, 73, 48, 0.05);
}

.org-header {
  text-align: center;
  margin-bottom: 24px;
}

.org-header h3 {
  margin: 4px 0 4px;
  font-size: 18px;
  color: var(--green-dark);
}

.org-header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.org-tree {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.org-tier-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

.org-consult-line {
  width: 48px;
  height: 2px;
  border-top: 2px dashed var(--gold);
}

.org-node {
  background: #f8fbf9;
  border: 1px solid #cfe2d6;
  border-radius: 14px;
  padding: 12px 16px;
  text-align: center;
  min-width: 200px;
  box-shadow: 0 3px 12px rgba(23, 107, 77, 0.05);
}

.org-node-role {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 4px;
}

.org-node-name {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.org-node-sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.org-node.datok {
  background: linear-gradient(145deg, #103f31, #176b4d);
  border-color: var(--gold);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 16px 20px;
  min-width: 280px;
}

.org-node.datok .org-node-role {
  color: var(--gold);
}

.org-node.datok .org-node-name {
  color: var(--white);
  font-size: 18px;
}

.org-node.datok .org-node-sub {
  color: #d6ebe0;
}

.org-photo-frame {
  width: 92px;
  height: 108px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.org-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
}

.org-photo-frame.sm {
  width: 58px;
  height: 68px;
  border-radius: 10px;
  border: 1.5px solid #b9d3c3;
  background: var(--mint);
}

.org-node.with-photo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
}

.official-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.official-edit-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.official-edit-card .head-photo-box {
  width: 60px;
  height: 72px;
  flex-shrink: 0;
}

.official-edit-meta {
  flex: 1;
  min-width: 0;
}

.official-edit-meta input[type="text"] {
  width: 100%;
  border: 1px solid #d7e2db;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  margin: 4px 0 8px;
}

.official-edit-meta input[type="file"] {
  font-size: 11.5px;
  max-width: 100%;
}

@media (max-width: 760px) {
  .official-edit-grid {
    grid-template-columns: 1fr;
  }
}

.org-connector-v {
  width: 2px;
  height: 18px;
  background: #b9d3c3;
  margin: -10px auto;
}

.org-node.sekretaris {
  background: #fff9ec;
  border-color: #ecd08b;
  min-width: 240px;
}

.org-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  gap: 14px;
  width: min(640px, 100%);
  position: relative;
}

.org-kadus-wrap {
  width: min(760px, 100%);
  border-top: 2px solid #b9d3c3;
  padding-top: 16px;
}

.org-kadus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.org-node.kadus {
  min-width: 0;
  background: var(--mint);
  border-color: #b7dec7;
}

.org-node.lembaga {
  background: #f3f7f5;
  min-width: 250px;
}

.org-node.society {
  background: linear-gradient(135deg, #eaf5ef, #fff8e7);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 14px 36px;
  min-width: 240px;
}

.dusun-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.dusun-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 5px 18px rgba(29, 73, 48, 0.04);
}

.dusun-kadus-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 11px;
  border-radius: 20px;
  background: var(--mint);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.welfare-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 14px 0 18px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.demo-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
}

.demo-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.demo-card small {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.demo-card strong {
  display: block;
  font-size: 17px;
  color: var(--green);
  margin-top: 4px;
}

.welfare-kpi {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.welfare-kpi small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--green2);
}

.welfare-kpi strong {
  display: block;
  font-size: 18px;
  margin: 6px 0 4px;
  color: var(--ink);
}

.welfare-kpi span {
  font-size: 12px;
  color: var(--muted);
}

.head-photo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.head-photo-box {
  width: 72px;
  height: 86px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--mint);
  display: grid;
  place-items: center;
}

.head-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg-preview {
  width: 150px;
  height: 86px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--mint);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px;
}

.hero-bg-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

@media (max-width: 820px) {
  .org-kadus-grid,
  .dusun-grid {
    grid-template-columns: 1fr;
  }

  .welfare-kpis,
  .demo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .org-pair-grid {
    grid-template-columns: 1fr;
  }

  .org-consult-line {
    display: none;
  }
}

.admin-split {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 18px;
  align-items: start;
}

.admin-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-row-2 {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-row-2 input,
.admin-row-3 input,
.admin-row-4 input {
  width: 100%;
  border: 1px solid #d7e2db;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .admin-row-2 {
    grid-template-columns: 1fr;
  }
}

.admin-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.mobile-bar {
  display: none;
}

.card h3:first-child,
.service b:first-child {
  margin-top: 0;
}

.admin-stats-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 5px 18px rgba(29, 73, 48, 0.04);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.admin-stat-item {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.admin-stat-item:hover {
  border-color: var(--green2);
  transform: translateY(-1px);
}

.admin-stat-item b {
  display: block;
  font-size: 24px;
  color: var(--green);
  line-height: 1.1;
}

.admin-stat-item span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

.admin-stat-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.login-card {
  max-width: 430px;
  margin: 48px auto;
}

html,
body {
  overflow-x: hidden;
}

@media (max-width: 900px) {
  .links {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 12px 4% 18px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(16, 63, 49, 0.12);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .links a {
    padding: 11px 10px;
    border-radius: 9px;
  }

  .links.open {
    display: flex;
  }

  .menu {
    display: block;
    min-width: 44px;
    min-height: 44px;
  }

  .hero-grid,
  .profile-grid,
  .admin-split {
    grid-template-columns: 1fr;
  }

  .grid,
  .news-grid,
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-head {
    display: block;
  }

  .section-head p {
    margin-top: 10px;
  }

  .foot {
    grid-template-columns: 1fr 1fr;
  }

  .admin-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .table-wrap {
    border: 0;
    background: transparent;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(29, 73, 48, 0.04);
  }

  .table-wrap td {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 4px;
  }

  .inline-controls {
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .inline-controls select,
  .inline-controls input,
  .inline-controls .btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: 93%;
  }

  .nav {
    height: 66px;
    gap: 10px;
  }

  .links {
    top: 66px;
  }

  .brand {
    font-size: 13.5px;
    gap: 9px;
    min-width: 0;
  }

  .brand small {
    font-size: 9.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .seal {
    width: 40px;
    height: 40px;
  }

  .nav .btn.small {
    padding: 6px 9px;
    font-size: 11px;
    white-space: nowrap;
  }

  .hero {
    padding: 38px 0 34px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero p {
    font-size: 14.5px;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }

  section {
    padding: 42px 0;
  }

  .grid,
  .news-grid,
  .service-grid,
  .foot,
  .admin-row-3 {
    grid-template-columns: 1fr;
  }

  .admin-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 40px;
  }

  .track-box {
    padding: 16px;
  }

  .track-form {
    flex-direction: column;
  }

  .track-form input,
  .track-form .btn {
    width: 100%;
    min-width: 0;
  }

  .org-chart {
    padding: 18px 14px;
  }

  .org-node,
  .org-node.datok,
  .org-node.sekretaris,
  .org-node.lembaga,
  .org-node.society {
    min-width: 0;
    width: 100%;
  }

  .org-node.datok {
    flex-direction: column;
    text-align: center;
    padding: 16px 14px;
  }

  .list-row {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .modal {
    padding: 10px;
    align-items: flex-end;
  }

  .dialog {
    padding: 18px;
    border-radius: 18px 18px 12px 12px;
    max-height: 92dvh;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(16, 63, 49, 0.08);
  }

  .mobile-bar a,
  .mobile-bar button {
    border: 0;
    background: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-bar span {
    font-size: 18px;
    line-height: 1.1;
  }

  footer {
    padding-bottom: 84px;
  }
}
