/* ============================================
   TEMA KREM COKLAT - Warm Elegant
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #edd9c8;
  min-height: 100vh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f5ede3;
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  background: #fdf8f4;
  border-bottom: 1px solid #edd9c8;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(140, 106, 80, 0.1);
}

.nav-btn {
  flex: 1;
  padding: 14px 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #d4b49a;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-btn.active {
  color: #5c3d28;
  border-bottom-color: #8c6a50;
  background: #f5ede3;
}

/* ===== HEADER CARD ===== */
.header-card {
  background-image: url("banner-pemuda.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: 16px;
  padding: 26px 20px 22px;
  margin-bottom: 16px;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(92, 61, 40, 0.22);
}

.header-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(92, 61, 40, 0.38) 0%,
    rgba(60, 30, 70, 0.45) 100%
  );
  border-radius: 16px;
  z-index: 0;
}

.header-card > * {
  position: relative;
  z-index: 1;
}

.logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}

.header-card h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 5px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  color: #fff;
}

.header-card p {
  font-size: 13px;
  opacity: 0.95;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  color: #fdf0e8;
}

.date-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  margin-top: 11px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  font-weight: 500;
}

/* ===== FORM CARD ===== */
.form-card {
  background: #fdf8f4;
  border: 1px solid #edd9c8;
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(140, 106, 80, 0.1);
}

.form-card h2 {
  font-size: 11px;
  font-weight: 600;
  color: #d4b49a;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.form-group {
  margin-bottom: 13px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #5c3d28;
  margin-bottom: 6px;
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #edd9c8;
  border-radius: 10px;
  font-size: 15px;
  background: #fdf8f4;
  color: #3d2010;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.form-group select:focus,
.form-group input:focus {
  border-color: #d4b49a;
  box-shadow: 0 0 0 3px rgba(212, 180, 154, 0.25);
  background: #fff;
}

/* SELECT ARROW - coklat hangat */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C6A50' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #8c6a50 0%, #5c3d28 100%);
  color: #fdf8f4;
  border: none;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(92, 61, 40, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9c7a60 0%, #6c4d38 100%);
  box-shadow: 0 6px 18px rgba(92, 61, 40, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.99) translateY(0);
  opacity: 0.92;
}

.btn-secondary {
  padding: 8px 14px;
  background: #fdf8f4;
  border: 1.5px solid #edd9c8;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  color: #5c3d28;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f5ede3;
  border-color: #d4b49a;
}

.btn-danger {
  padding: 8px 14px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #f87171;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  transition: all 0.2s;
}

.btn-export:hover {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

/* ===== SUCCESS / ERROR BOX ===== */
.success-box {
  background: linear-gradient(135deg, #fdf5ee 0%, #f5e8da 100%);
  border: 1px solid #edd9c8;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  margin-bottom: 16px;
}

.success-box .icon {
  font-size: 38px;
  margin-bottom: 8px;
}

.success-box h3 {
  color: #5c3d28;
  font-size: 16px;
  font-weight: 700;
}

.success-box p {
  color: #8c6a50;
  font-size: 13px;
  margin-top: 5px;
}

.error-box {
  background: #fdf0ee;
  border: 1px solid #e8b4ae;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  text-align: center;
}

.error-box p {
  color: #8b3a2e;
  font-size: 13px;
}

/* ===== QR SECTION ===== */
.qr-section {
  background: #fdf8f4;
  border: 1px solid #edd9c8;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(140, 106, 80, 0.08);
}

.qr-section h3 {
  font-size: 11px;
  font-weight: 600;
  color: #d4b49a;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

#qr-container {
  display: inline-block;
  padding: 14px;
  border: 1.5px solid #edd9c8;
  border-radius: 12px;
  background: #fff;
}

.qr-label {
  font-size: 12px;
  color: #d4b49a;
  margin-top: 10px;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: #fdf8f4;
  border: 1px solid #edd9c8;
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(140, 106, 80, 0.08);
}

.stat-card .num {
  font-size: 32px;
  font-weight: 800;
  color: #5c3d28;
}

.stat-card .lbl {
  font-size: 11px;
  color: #d4b49a;
  margin-top: 4px;
  font-weight: 500;
}

/* ===== TABLE ===== */
.table-wrap {
  background: #fdf8f4;
  border: 1px solid #edd9c8;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(140, 106, 80, 0.08);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid #edd9c8;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(135deg, #fdf8f4 0%, #f5ede3 100%);
}

.table-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: #5c3d28;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 280px;
}

thead tr {
  background: linear-gradient(135deg, #fdf8f4 0%, #f9f2ec 100%);
}

th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #d4b49a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  font-size: 13px;
  border-top: 1px solid #f5ede3;
  color: #3d2010;
}

tr:hover td {
  background: #fdf5ee;
}

/* Badge wilayah - sentuhan ungu kecil sebagai aksen */
.wilayah-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ede0f8 0%, #e8d5f0 100%);
  color: #6b4e8a;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  border: 1px solid #d8c0e8;
}

.time-badge {
  color: #d4b49a;
  font-size: 12px;
}

.empty-state {
  padding: 36px;
  text-align: center;
  color: #d4b49a;
  font-size: 13px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-bar select {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  border: 1.5px solid #edd9c8;
  border-radius: 10px;
  background: #fdf8f4;
  color: #3d2010;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C6A50' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  outline: none;
}

.filter-bar select:focus {
  border-color: #d4b49a;
  box-shadow: 0 0 0 3px rgba(212, 180, 154, 0.2);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #5c3d28, #3d2010);
  color: #fdf8f4;
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(92, 61, 40, 0.4);
}

.toast.show {
  opacity: 1;
}

/* ===== PAGE ===== */
.page {
  display: none;
  padding: 16px;
}

.page.active {
  display: block;
}

/* ===== BACK BUTTON ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fdf8f4;
  border: 1.5px solid #edd9c8;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  color: #5c3d28;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.back-btn:hover {
  background: #f5ede3;
}

/* ===== REKAP WILAYAH ===== */
#wilayah-summary {
  background: #fdf8f4;
  border: 1px solid #edd9c8;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(140, 106, 80, 0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

