:root {
  --ink: #17201c;
  --muted: #66736c;
  --line: #dce5df;
  --paper: #ffffff;
  --soft: #f4f7f3;
  --green: #176b45;
  --green-2: #0f8a59;
  --gold: #c78d1b;
  --blue: #266aa6;
  --coral: #c95843;
  --shadow: 0 24px 60px rgba(23, 32, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 900;
}

.brand strong,
.admin-brand strong {
  display: block;
  line-height: 1.15;
}

.brand small,
.admin-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.site-nav a,
.admin-nav button {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.admin-nav button:hover,
.admin-nav button.is-active {
  color: var(--green);
  background: #eaf3ee;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 20px rgba(23, 107, 69, 0.18);
}

.primary-button:hover {
  background: #125839;
}

.secondary-button {
  color: var(--green);
  background: #fff;
  border-color: var(--line);
}

.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.text-button {
  min-height: 34px;
  color: var(--blue);
  background: transparent;
  padding: 6px 8px;
}

.button-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
}

.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  max-height: 820px;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(34px, 7vw, 88px);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(244, 247, 243, 0.96) 0%, rgba(244, 247, 243, 0.82) 38%, rgba(244, 247, 243, 0.12) 72%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(660px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(40px, 7vw, 76px);
  max-width: 820px;
}

h2 {
  font-size: clamp(28px, 4vw, 46px);
}

h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.hero-content p:not(.eyebrow),
.section p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

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

.section {
  padding: clamp(56px, 8vw, 98px) clamp(18px, 4vw, 52px);
}

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

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 32px;
  align-items: center;
  background: #fff;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metrics-strip div {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metrics-strip div:last-child {
  border-right: 0;
}

.metrics-strip strong {
  display: block;
  font-size: clamp(24px, 4vw, 36px);
}

.metrics-strip span {
  color: var(--muted);
}

.services {
  background: #eef5f0;
}

.service-grid,
.post-grid,
.gallery-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.service-grid article,
.post-card,
.gallery-card,
.stat-card,
.panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 32, 28, 0.07);
}

.service-grid article {
  padding: 24px;
}

.service-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 900;
}

.service-grid article:nth-child(2) .service-icon,
.stat-card:nth-child(2) {
  background: #fffaf0;
}

.service-grid article:nth-child(2) .service-icon {
  background: var(--gold);
}

.service-grid article:nth-child(3) .service-icon,
.stat-card:nth-child(3) {
  background: #eef6fd;
}

.service-grid article:nth-child(3) .service-icon {
  background: var(--blue);
}

.service-grid article:nth-child(4) .service-icon,
.stat-card:nth-child(4) {
  background: #fff3f0;
}

.service-grid article:nth-child(4) .service-icon {
  background: var(--coral);
}

.limit-section {
  background: var(--ink);
  color: #fff;
}

.limit-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 28px;
  align-items: center;
}

.limit-panel p,
.limit-display small {
  color: #d9e5de;
}

.limit-display {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.limit-display strong {
  display: block;
  margin: 16px 0 4px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #0f5b3c;
  background: #dff4e9;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.is-danger {
  color: #8e2b1d;
  background: #ffe0da;
}

.status-pill.is-warn {
  color: #7b5100;
  background: #fff0c7;
}

.application-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
  background: #fff;
}

.public-form,
.form-panel {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(15, 138, 89, 0.13);
}

.post-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.post-card .tag {
  justify-self: start;
  color: var(--blue);
  background: #eaf4ff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.gallery-card {
  overflow: hidden;
}

.gallery-visual {
  min-height: 168px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, #176b45, #9ccf7d);
}

.gallery-visual.hero-photo {
  background-image: linear-gradient(0deg, rgba(23, 32, 28, 0.12), rgba(23, 32, 28, 0.12)), url("../images/koperasi-hero.png");
  background-size: cover;
  background-position: center;
}

.gallery-visual.blue {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, #266aa6, #8ab7df);
}

.gallery-visual.gold {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, #c78d1b, #f1cf73);
}

.gallery-visual.coral {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, #c95843, #f29b8b);
}

.gallery-card div:last-child {
  padding: 18px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.admin-sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav button {
  width: 100%;
  text-align: left;
}

.full {
  width: 100%;
  margin-top: auto;
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

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

.admin-top h1 {
  font-size: clamp(30px, 4vw, 48px);
}

.admin-tab {
  display: none;
}

.admin-tab.is-visible {
  display: block;
}

.stat-grid {
  margin-bottom: 18px;
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(22px, 3vw, 32px);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel h2 {
  font-size: 22px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-panel {
  max-width: 880px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.mini-button.danger {
  color: #9f3526;
  background: #fff5f2;
  border-color: #ffd6cf;
}

.mini-button.ok {
  color: var(--green);
  background: #edf8f2;
  border-color: #cfeadb;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.compact-item strong,
.compact-item span {
  overflow-wrap: anywhere;
}

.compact-item small {
  color: var(--muted);
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.bar-fill {
  height: 100%;
  width: var(--value);
  background: var(--green);
}

.bar-fill.credit {
  background: var(--coral);
}

.search-input {
  max-width: 230px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  justify-content: center;
  padding: 24px;
  color: #dce8e0;
  background: #111815;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .service-grid,
  .post-grid,
  .gallery-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-grid,
  .application-band,
  .admin-grid,
  .limit-panel {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    top: 0;
    height: auto;
  }

  .admin-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 10px 14px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 720px;
    padding: 28px 18px;
  }

  .hero-shade {
    background: linear-gradient(0deg, rgba(244, 247, 243, 0.96) 0%, rgba(244, 247, 243, 0.86) 60%, rgba(244, 247, 243, 0.24) 100%);
  }

  .service-grid,
  .post-grid,
  .gallery-grid,
  .stat-grid,
  .metrics-strip,
  .form-grid,
  .admin-nav {
    grid-template-columns: 1fr;
  }

  .metrics-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics-strip div:last-child {
    border-bottom: 0;
  }

  .section-head,
  .admin-top,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-main {
    padding: 18px;
  }

  .search-input {
    max-width: none;
  }
}
