@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f8fa;
  --text: #071b22;
  --muted: #64767d;
  --border: #dde8ec;
  --card: #ffffff;
  --sidebar: #004d5a;
  --sidebar-deep: #003f49;
  --teal: #0098b3;
  --teal-dark: #007f96;
  --yellow: #ffc20e;
  --green: #15803d;
  --red: #dc2626;
  --shadow: 0 16px 40px rgba(8, 38, 47, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

button,
input,
select {
  font: inherit;
}

svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar), #004651);
  color: #effbff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-backdrop {
  display: none;
}

.brand {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand span {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #00a7c7, #35c6d6);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.brand strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.nav-label {
  margin: 26px 24px 14px;
  color: rgba(239, 251, 255, 0.52);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar nav {
  padding: 0 16px;
  display: grid;
  gap: 8px;
}

.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(239, 251, 255, 0.72);
  padding: 13px 12px;
  border-radius: 11px;
  font-weight: 600;
  transition: 180ms ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 8px 8px 0;
  background: var(--yellow);
}

.sidebar nav a.active svg {
  color: var(--yellow);
}

.operator-card {
  margin-top: auto;
  padding: 26px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(239, 251, 255, 0.92);
}

.operator-card > svg {
  width: 34px;
  height: 34px;
  color: rgba(239, 251, 255, 0.55);
}

.operator-card div {
  display: grid;
}

.operator-card strong {
  font-size: 14px;
}

.operator-card span {
  color: rgba(239, 251, 255, 0.48);
  font-size: 12px;
}

.content-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.menu-toggle {
  display: none;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.icon-button:hover {
  background: #eef5f7;
  color: var(--text);
}

.notification {
  position: relative;
}

.notification::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--red);
  border: 2px solid white;
}

.main-content {
  width: min(100%, 1152px);
  margin: 0 auto;
  padding: 32px;
  animation: pageIn 460ms ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  border-radius: 18px;
  padding: 48px;
  display: flex;
  align-items: center;
  color: white;
  background: radial-gradient(circle at 82% 24%, rgba(255, 194, 14, 0.25), transparent 22%), linear-gradient(135deg, #099bb7, #25b2c8 52%, #1fa7bb);
  box-shadow: var(--shadow);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.official-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  font-weight: 600;
  font-size: 14px;
}

.official-pill svg {
  color: var(--yellow);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.hero h1 span {
  color: var(--yellow);
}

.hero p {
  margin: 0 0 34px;
  font-size: 19px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  cursor: pointer;
  transition: 180ms ease;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button.yellow {
  color: #0b1b20;
  background: var(--yellow);
  box-shadow: 0 14px 30px rgba(255, 194, 14, 0.26);
}

.button.yellow:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.button.ghost {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.button.primary {
  color: white;
  background: var(--teal);
}

.button.outline {
  color: var(--text);
  background: white;
  border-color: var(--border);
}

.button.outline:hover,
.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(8, 38, 47, 0.08);
}

.button.small {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
}

.hero-bolt {
  position: absolute;
  right: -70px;
  bottom: -120px;
  color: rgba(255, 255, 255, 0.12);
}

.hero-bolt svg {
  width: 430px;
  height: 430px;
}

.stats-grid {
  margin: 32px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card,
.module-card,
.panel,
.map-panel,
.list-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 rgba(8, 38, 47, 0.03);
}

.stat-card {
  padding: 22px;
  transition: 180ms ease;
}

.stat-card:hover,
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-top {
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-icon,
.module-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: #e3f8fb;
}

.change,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 9px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.green {
  color: var(--green);
  background: #dcfce7;
}

.red {
  color: var(--red);
  background: #fee2e2;
}

.yellow {
  color: #a16207;
  background: #fef3c7;
}

.neutral {
  color: #475569;
  background: #f1f5f9;
}

.stat-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.stat-card strong {
  font-size: 28px;
  letter-spacing: -0.04em;
}

.module-section h2 {
  margin: 0 0 24px;
  font-size: 22px;
}

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

.module-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.module-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 140px;
  height: 140px;
  border-radius: 0 18px 0 999px;
  opacity: 0.55;
}

.primary-module::after {
  background: #e3f8fb;
}

.yellow-module::after {
  background: #fff1b8;
}

.yellow-module .module-icon {
  color: #7c5800;
  background: #fff1b8;
}

.module-card h3 {
  margin: 26px 0 10px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.module-card p {
  max-width: 620px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.module-card a {
  color: var(--teal-dark);
  font-weight: 800;
}

.page-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-heading h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.panel {
  overflow: hidden;
}

.panel-toolbar {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.filter-form {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f9fcfd);
}

.filter-form label {
  display: grid;
  gap: 7px;
}

.filter-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-form input,
.filter-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: white;
  outline: none;
}

.filter-form input:focus,
.filter-form select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 152, 179, 0.12);
}

.validasi-summary {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: #f7fbfc;
}

.validasi-summary div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
}

.validasi-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.validasi-summary strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.toolbar-note {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.alert-error {
  margin: 16px;
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-radius: 13px;
  color: #991b1b;
  background: #fff1f2;
  font-weight: 700;
  line-height: 1.5;
}

.search-box {
  width: min(100%, 390px);
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 13px;
  color: var(--muted);
  width: 17px;
  height: 17px;
}

.search-box input {
  width: 100%;
  min-height: 40px;
  padding: 0 14px 0 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  outline: none;
  background: #f4f8fa;
}

.search-box input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 152, 179, 0.12);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: #f5f8fa;
  font-weight: 800;
}

.data-table th {
  cursor: pointer;
  user-select: none;
}

.data-table th[data-sort-direction='asc']::after {
  content: ' ↑';
  color: var(--teal);
}

.data-table th[data-sort-direction='desc']::after {
  content: ' ↓';
  color: var(--teal);
}

th,
td {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr:hover {
  background: #f7fbfc;
}

.empty-cell {
  padding: 34px 22px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.right {
  text-align: right;
}

.muted {
  color: var(--muted);
}

.badge svg {
  width: 14px;
  height: 14px;
}

.pagination {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.pagination div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination button {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 9px;
  padding: 7px 10px;
  font-weight: 700;
}

.pagination button.selected {
  color: var(--teal-dark);
  background: #e3f8fb;
  border-color: #b9edf4;
}

.pagination button:disabled {
  opacity: 0.5;
}

.survey-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr);
  gap: 24px;
}

.map-panel,
.list-panel {
  overflow: hidden;
  height: 600px;
  display: flex;
  flex-direction: column;
}

.panel-title,
.list-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title h3,
.list-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.list-head {
  display: grid;
  gap: 14px;
}

.list-head .search-box {
  width: 100%;
}

.map-canvas {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 1px 1px, #d9e7eb 1px, transparent 0), linear-gradient(135deg, #eefaff, #f7fcff);
  background-size: 40px 40px, 100% 100%;
}

.map-canvas::before,
.map-canvas::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 152, 179, 0.08);
  transform: rotate(-26deg);
}

.map-canvas::after {
  transform: rotate(32deg);
  width: 55%;
  background: rgba(255, 194, 14, 0.12);
}

.marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid white;
  box-shadow: 0 8px 20px rgba(8, 38, 47, 0.2);
  z-index: 1;
}

.marker.teal {
  top: 25%;
  left: 34%;
  background: var(--teal);
}

.marker.red {
  top: 52%;
  left: 53%;
  background: var(--red);
}

.marker.yellow {
  right: 25%;
  bottom: 33%;
  background: var(--yellow);
}

.map-note {
  position: relative;
  z-index: 2;
  width: min(86%, 360px);
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.map-note > svg {
  color: #95a8af;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
}

.map-note strong {
  display: block;
}

.map-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.survey-list {
  flex: 1;
  overflow: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.survey-item {
  padding: 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: white;
  transition: 180ms ease;
}

.survey-item:hover {
  border-color: rgba(0, 152, 179, 0.35);
  background: #f1fcfe;
}

.survey-top,
.survey-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.survey-top strong {
  font-size: 14px;
}

.condition {
  display: inline-flex;
  border-radius: 50%;
  background: transparent;
}

.condition svg {
  width: 18px;
  height: 18px;
}

.survey-item p {
  margin: 10px 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.survey-item code {
  color: var(--muted);
  font-size: 12px;
}

.survey-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.survey-meta span {
  color: var(--muted);
  background: #f2f6f8;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.survey-meta small {
  color: var(--muted);
}

.not-found {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.not-found h1 {
  margin: 0;
  font-size: 86px;
  color: var(--teal);
}

.not-found p {
  margin: 0 0 10px;
  color: var(--muted);
}

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

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

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(82vw, 288px);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 240ms ease;
    box-shadow: 20px 0 45px rgba(8, 38, 47, 0.2);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    pointer-events: none;
    background: rgba(4, 24, 30, 0);
    transition: background 220ms ease;
  }

  body.sidebar-open .sidebar-backdrop {
    pointer-events: auto;
    background: rgba(4, 24, 30, 0.48);
  }

  .operator-card {
    display: flex;
  }

  .menu-toggle {
    display: inline-grid;
    background: #eef7f9;
    color: var(--teal-dark);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .topbar {
    padding: 0 18px;
  }

  .main-content {
    padding: 20px;
  }

  .hero {
    min-height: auto;
    padding: 32px 24px;
  }

  .stats-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .panel-toolbar,
  .filter-form,
  .pagination,
  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-form,
  .validasi-summary {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 100%;
  }

  .map-panel,
  .list-panel {
    height: auto;
    min-height: 480px;
  }
}
