:root {
  --primary: #25d366;
  --primary-dark: #128c7e;
  --secondary: #f4b000;
  --bg: #eef9ff;
  --card: #ffffff;
  --text: #2f3a44;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(186, 230, 253, 0.75), transparent 34%),
    linear-gradient(180deg, #e0f2fe 0%, #f8fcff 48%, #ffffff 100%);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 92px;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.container { width: min(1220px, calc(100% - 24px)); margin: 0 auto; }

.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 12px 0;
  box-shadow: 0 6px 20px rgba(18, 140, 126, 0.2);
}
.header-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(310px, 0.74fr) minmax(310px, 1fr);
  align-items: center;
  gap: 22px;
}
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  min-width: min(360px, 100%);
}
.brand-text h1 { font-size: clamp(26px, 2.2vw, 36px); line-height: 1.08; font-weight: 900; }
.brand-text p { font-size: clamp(14px, 1.08vw, 18px); opacity: .94; margin-top: 6px; font-weight: 700; }
.brand-side { display: grid; place-items: center; }
.brand-side.left { justify-self: start; }
.header-logos {
  display: flex; align-items: center; gap: 12px; min-height: 72px;
  margin: 6px 0;
}
.logo-mark {
  width: 66px; height: 66px;
  background: rgba(255,255,255,.96); color: #0f766e;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 900; line-height: 1.1; text-align: center;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .18);
}
.logo-mark.image-logo { overflow: hidden; }
.logo-mark.image-logo img {
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain; object-position: center; display: block;
  transform-origin: center;
}
.logo-binjai img { max-width: 92%; max-height: 92%; transform: translateY(-3px); }
.logo-kemendagri img { max-width: 92%; max-height: 92%; transform: translateY(-3px); }
.header-contact {
  justify-self: end; display: flex; flex-direction: column; align-items: stretch; gap: 7px;
  min-width: 0; width: min(100%, 460px); font-size: 14px; font-weight: 900;
  text-align: justify;
}
.header-contact > a, .header-contact > span {
  display: flex; align-items: flex-start; gap: 9px; max-width: 100%; width: 100%;
  color: rgba(255,255,255,.96);
  line-height: 1.35;
}
.contact-icon {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(255,255,255,.2); flex: 0 0 auto; font-size: 12px;
}
.contact-text {
  display: block; overflow: visible; text-overflow: clip; white-space: normal;
  text-align: justify; text-align-last: left;
}

.hero { padding: 16px 0 8px; }
.hero-card {
  position: relative;
  aspect-ratio: 16 / 7;
  min-height: 150px;
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #cfeeff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.slide { position: absolute; inset: 0; opacity: 0; animation: heroSlide 10s infinite; background: #fff; }
.slide:nth-child(2) { animation-delay: 5s; }
.slide img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
@keyframes heroSlide {
  0%, 44% { opacity: 1; transform: translateX(0); }
  50%, 94% { opacity: 0; transform: translateX(-10px); }
  100% { opacity: 0; transform: translateX(0); }
}

.notice-strip { margin: 8px 0 0; }
.service-hours {
  display: flex; align-items: center; gap: 12px;
  background: #fff; color: #0f766e;
  border: 1px solid #bdebd9; border-radius: 16px;
  padding: 12px 14px; box-shadow: var(--shadow);
  font-size: 13px; font-weight: 800;
}
.alarm-logo {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, var(--primary));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto;
}

.section { padding: 18px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h3 { font-size: 18px; font-weight: 900; color: #1f2937; }
.section-title span { font-size: 13px; color: var(--muted); text-align: right; }
.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.app-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 10px; box-shadow: var(--shadow); transition: .2s ease;
  min-height: 136px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; overflow: hidden;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.icon-box {
  width: 64px; height: 64px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; font-size: 28px; color: #fff;
  box-shadow: inset 0 -10px 16px rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.app-title { font-size: 14px; font-weight: 900; line-height: 1.25; color: #3f3f46; }
.app-subtitle { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.c-info { background: #b592d6; }
.c-daftar { background: #f3c63f; color: #583d00; }
.c-sipermen { background: #5bb8b7; }
.c-formulir { background: #f68849; }
.c-pengaduan { background: #ace6be; color: #155e3a; }
.c-syarat { background: #eee8a8; color: #665c00; }
.c-video { background: #8cc9ec; color: #dc2626; }
.c-skm { background: #0f1b29; }

.visitor-card {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  background: #fff; border: 1px solid #cfeeff; border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.visitor-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, #0ea5e9, var(--primary)); color: #fff; font-size: 22px;
}
.visitor-number { font-size: 24px; font-weight: 900; color: #0f766e; line-height: 1.1; }
.visitor-label { font-size: 13px; color: var(--muted); font-weight: 700; }

.rating-card, .panel, .card {
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.rating-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rating-header h3 { font-size: 17px; line-height: 1.35; font-weight: 900; color: #3f3f46; }
.rating-menu { color: #737373; font-size: 22px; }
.chart-area { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center; justify-items: center; padding: 8px 0 4px; }
.pie-wrap { position: relative; width: min(260px, 78vw); aspect-ratio: 1; display: grid; place-items: center; }
.pie {
  width: 72%; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(#00f20c 0deg 294.84deg, #12dedb 294.84deg 346.32deg, #2e86c1 346.32deg 353.52deg, #f5cd3d 353.52deg 356.4deg, #e84c3d 356.4deg 360deg);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}
.chart-label {
  position: absolute; font-size: 11px; line-height: 1.15; font-weight: 900; color: #171717;
  background: rgba(255,255,255,.8); border-radius: 10px; padding: 5px 7px; box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.label-sp { right: 0; bottom: 18%; }
.label-puas { left: 0; top: 45%; }
.label-cukup { left: 2%; top: 25%; }
.label-kurang { left: 10%; top: 10%; }
.label-tidak { left: 40%; top: 0; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 18px; margin-top: 8px; font-weight: 900; color: #454545; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.green { background: #00f20c; } .cyan { background: #12dedb; } .blue { background: #2e86c1; } .yellow { background: #f5cd3d; } .red { background: #e84c3d; }

.footer-panels { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 6px; }
.panel h4 { font-size: 15px; font-weight: 900; margin-bottom: 8px; color: #111827; }
.panel p, .panel li { font-size: 13px; color: var(--muted); line-height: 1.6; }
footer { padding: 18px 0 28px; color: var(--muted); font-size: 12px; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #e5e7eb;
  display: flex; justify-content: space-around; align-items: center; padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  z-index: 200; box-shadow: 0 -8px 24px rgba(0,0,0,.06);
}
.bottom-item { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: #6b7280; min-width: 58px; }
.bottom-item i { font-size: 18px; }
.bottom-item.active { color: var(--primary); font-weight: 800; }

.page-hero { padding: 22px 0 12px; }
.hero-panel {
  background: linear-gradient(135deg, #fff, #e4f7ff);
  border: 1px solid #cfeeff; border-radius: 22px; padding: 22px; box-shadow: var(--shadow);
}
.back-link, .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: #0f766e; font-weight: 900; font-size: 13px;
}
.back-link { margin-bottom: 12px; }
.eyebrow { background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 999px; padding: 7px 11px; font-size: 12px; margin-bottom: 10px; }
.hero-panel h2 { font-size: clamp(24px, 4vw, 38px); line-height: 1.15; color: #172033; margin-bottom: 10px; }
.hero-panel p { color: var(--muted); max-width: 760px; font-size: 15px; }
.content-card { font-size: 15px; color: #4b5563; }
.content-card p { margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
.grid.two { grid-template-columns: 1fr; }
.card h3 { font-size: 18px; line-height: 1.25; margin-bottom: 10px; color: #172033; }
.card h4 { font-size: 15px; margin: 14px 0 8px; color: #0f766e; }
.card p, .card li { font-size: 14px; color: var(--muted); }
.card ul, .card ol { margin-left: 20px; display: grid; gap: 7px; }
.notice { border-color: #fed7aa; background: #fff7ed; }
.notice h3, .danger h3 { color: #9a3412; }
.danger { border-color: #fecaca; background: #fff5f5; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; border-radius: 12px; padding: 10px 14px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-size: 13px; font-weight: 900;
}
.btn.secondary { color: #0f766e; background: #ecfdf5; border: 1px solid #bbf7d0; }
.list-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.list-item {
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center;
  background: #fff; border: 1px solid #dbeafe; border-radius: 16px; padding: 14px; box-shadow: var(--shadow);
}
.list-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #ecfdf5; color: #0f766e; font-size: 20px; }
.list-item strong { display: block; font-size: 14px; color: #172033; }
.list-item small { display: block; color: var(--muted); margin-top: 4px; }

.admin-login-body { min-height: 100vh; padding: 0; display: grid; place-items: center; }
.login-shell { width: min(440px, calc(100% - 24px)); }
.login-card, .admin-card, .admin-stat {
  background: #fff; border: 1px solid #dbeafe; border-radius: 18px; box-shadow: var(--shadow);
}
.login-card { padding: 28px; }
.login-brand { color: #0f766e; font-size: 13px; font-weight: 900; margin-bottom: 8px; }
.login-card h1 { font-size: 28px; line-height: 1.1; margin-bottom: 8px; color: #172033; }
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; background: #f8fbff; padding: 0; }
.admin-sidebar {
  background: #0f766e; color: #fff; min-height: 100vh; padding: 24px 18px; position: sticky; top: 0;
}
.admin-sidebar h1 { font-size: 24px; line-height: 1; }
.admin-sidebar p { opacity: .78; margin: 8px 0 22px; font-size: 13px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar a, .admin-logout {
  color: #fff; border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 13px; border: 0; text-align: left; background: transparent;
}
.admin-sidebar a.active, .admin-sidebar a:hover, .admin-logout:hover { background: rgba(255,255,255,.16); }
.admin-logout { margin-top: 22px; width: 100%; cursor: pointer; }
.admin-content { padding: 28px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.admin-topbar h2 { font-size: 28px; color: #172033; }
.admin-topbar p { color: var(--muted); font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.admin-stat { padding: 20px; display: grid; gap: 6px; transition: .2s ease; }
.admin-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.admin-stat strong { font-size: 34px; color: #0f766e; line-height: 1; }
.admin-stat span { font-weight: 900; color: #172033; }
.admin-card { padding: 18px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { border-bottom: 1px solid #e5e7eb; padding: 10px; text-align: left; vertical-align: top; }
.admin-table th { color: #172033; }
.table-action { display: inline-flex; margin-right: 8px; color: #0f766e; font-weight: 900; }
.table-action.danger { color: #dc2626; }
.admin-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
  border-radius: 12px; padding: 10px 14px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-size: 13px; font-weight: 900; border: 0; cursor: pointer;
}
.admin-btn.ghost { color: #0f766e; background: #ecfdf5; border: 1px solid #bbf7d0; }
.admin-btn.full { width: 100%; }
.admin-form { display: grid; gap: 14px; }
.admin-form label { display: block; font-weight: 900; font-size: 13px; color: #172033; margin-bottom: 6px; }
.admin-form input[type="text"], .admin-form input[type="password"], .admin-form input[type="file"], .admin-form textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 12px; padding: 10px 12px; background: #fff;
}
.admin-form .help-block { color: #b91c1c; font-size: 12px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.current-file { font-size: 12px; color: var(--muted); margin-top: 4px; }
.flash { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-weight: 800; font-size: 13px; }
.flash-success { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.flash-error { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }

@media (min-width: 640px) {
  .app-grid { grid-template-columns: repeat(3, 1fr); }
  .pie-wrap { width: 330px; }
  .chart-label { font-size: 13px; }
}
@media (min-width: 992px) {
  body { padding-bottom: 30px; }
  .app-grid { grid-template-columns: repeat(4, 1fr); }
  .app-card { min-height: 144px; }
  .icon-box { width: 70px; height: 70px; font-size: 30px; }
  .bottom-nav { display: none; }
  .hero { padding-top: 18px; }
  .hero-card { min-height: 220px; max-width: 780px; }
  .footer-panels { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: repeat(2, 1fr); }
  .rating-card { padding: 24px; }
  .rating-header h3 { font-size: 22px; text-align: center; width: 100%; }
  .pie-wrap { width: 420px; }
  .legend-item { font-size: 16px; }
}
@media (max-width: 860px) {
  .header-row { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
  .brand-side.left { justify-self: center; }
  .header-logos { min-height: 62px; margin: 4px 0; }
  .logo-mark { width: 58px; height: 58px; padding: 7px; border-radius: 14px; }
  .logo-binjai img, .logo-kemendagri img { transform: translateY(-2px); }
  .brand { min-width: 0; }
  .brand-text h1 { font-size: clamp(24px, 7vw, 30px); }
  .brand-text p { font-size: 14px; }
  .header-contact { justify-self: center; align-items: stretch; max-width: 430px; width: 100%; font-size: 13px; }
  .header-contact > a, .header-contact > span { justify-content: center; }
  .contact-text { max-width: min(360px, calc(100vw - 78px)); text-align: left; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; min-height: auto; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
}
