:root {
  --navy: #0e2e4c;
  --navy-dark: #0a2238;
  --gold: #ffb508;
  --blue: #0593ba;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #2a2f36;
  --muted: #6b7684;
  --border: #dde3ea;
  --error: #b3261e;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  background: var(--navy);
  color: #fff;
  padding: 18px 20px;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.field {
  margin-bottom: 20px;
}

.field:last-child { margin-bottom: 0; }

label.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field-label .req { color: var(--error); margin-left: 2px; }

.field-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 8px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

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

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14, 46, 76, 0.12);
}

.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option, .checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.radio-option input, .checkbox-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.rating-group {
  display: flex;
  gap: 8px;
}

.rating-option {
  flex: 1;
  text-align: center;
}

.rating-option input { position: absolute; opacity: 0; }

.rating-option label {
  display: block;
  padding: 10px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.rating-option input:checked + label {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.conditional-block {
  display: none;
  border-left: 3px solid var(--navy);
  padding-left: 16px;
  margin-top: 16px;
}

.conditional-block.active { display: block; }

.error-text {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 6px;
  display: none;
}

.submit-bar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 0 24px;
}

button.btn-submit {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

button.btn-submit:hover { background: var(--navy-dark); }
button.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Site header (mengikuti gaya navbar pkbm.id) */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.15);
}

.site-header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo img {
  height: 40px;
  display: block;
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-header-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.site-header-nav a:hover { color: var(--gold); }

.site-header-badge {
  background: rgba(255, 181, 8, 0.15);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .site-header-inner { flex-direction: column; text-align: center; }
  .site-header-nav { flex-direction: column; align-items: center; gap: 8px; }
}

.page-title {
  text-align: center;
  margin: 24px 0 24px;
}

.page-title h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: var(--navy-dark);
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.page-title h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.page-title p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.alert {
  background: #fdecea;
  border: 1px solid #f5c2bd;
  color: var(--error);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.thankyou {
  text-align: center;
  padding: 60px 20px;
}

.thankyou h1 { color: var(--navy-dark); }

/* Admin */
.admin-body { background: #f5f5f5; }

.admin-nav {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 3px solid var(--gold);
}

.admin-nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-nav-logo {
  height: 28px;
  width: 28px;
}

.admin-nav a {
  color: #fff;
  text-decoration: none;
  margin-right: 16px;
  font-size: 0.95rem;
}

.admin-nav a:hover { text-decoration: underline; }

.role-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

.role-badge-super {
  background: rgba(255, 181, 8, 0.2);
  color: var(--gold);
}

.role-badge-admin {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.btn-sm:hover { background: var(--bg); }

.btn-danger-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(179, 38, 30, 0.3);
  background: #fdecea;
  color: var(--error);
  cursor: pointer;
}

.btn-danger-sm:hover { background: #f8d3cf; }

.admin-table-form { display: flex; gap: 6px; align-items: center; }
.admin-table-form input[type="password"] { width: 160px; padding: 6px 8px; }

.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-card .num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.85rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: #fff;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.filter-bar select, .filter-bar input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.filter-bar button, .filter-bar a.btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.88rem;
}

table.data-table th, table.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table th {
  background: #e8edf3;
  color: var(--navy-dark);
}

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.login-wrap {
  max-width: 380px;
  margin: 80px auto;
  padding: 0 16px;
}

.pagination {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
}

.pagination .active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
