* {
      box-sizing: border-box;
    }

    html, body {
      margin: 0;
      padding: 0;
      background-color: #F8FAFC;
      color: #1e293b;
      font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
      min-height: 100vh;
    }

    h1, h2, h3, h4, h5, h6 {
      color: #0F172A;
    }

    label, strong, .card-title, .navbar-title {
      color: #0F172A;
    }

    p, span, td, th, li, small, .form-label {
      color: #334155;
    }

    .site-header {
      background-color: #ffffff;
      border-bottom: 1px solid #E2E8F0;
      padding: 14px 0;
      box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .site-header .logo {
      font-size: 1.25rem;
      font-weight: 800;
      color: #0F172A;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      letter-spacing: -0.02em;
      transition: opacity 0.15s ease;
    }

    .site-header .logo:hover {
      opacity: 0.75;
    }

    .site-header .logo .blue {
      color: #2563EB;
    }

    .site-header .subtitle {
      color: #64748b;
      font-size: 0.85rem;
      font-weight: 500;
    }

    .main-container {
      max-width: 1140px;
      margin: 0 auto;
      padding: 28px 16px 56px;
    }

    .hero-title {
      font-size: 1.55rem;
      font-weight: 800;
      color: #0F172A;
      margin-bottom: 6px;
      letter-spacing: -0.02em;
    }

    .hero-desc {
      color: #64748b;
      margin-bottom: 20px;
      line-height: 1.6;
      font-size: 0.95rem;
    }

    .main-nav {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 24px;
      padding: 6px;
      background-color: #EFF6FF;
      border: 1px solid #BFDBFE;
      border-radius: 12px;
    }

    .main-nav button {
      flex: 1 1 auto;
      min-width: 140px;
      padding: 11px 18px;
      font-size: 0.9rem;
      font-weight: 600;
      color: #3B82F6;
      background-color: transparent;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
      font-family: "Inter", sans-serif;
    }

    .main-nav button:hover {
      background-color: rgba(37, 99, 235, 0.08);
      color: #1D4ED8;
    }

    .main-nav button.nav-active {
      background: linear-gradient(135deg, #2563EB, #4F46E5);
      color: #ffffff;
      box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
    }

    .page-view {
      display: none;
    }

    .page-view.page-visible {
      display: block;
    }

    .card-box {
      background-color: #ffffff;
      border: 1px solid #E2E8F0;
      border-radius: 12px;
      box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(15, 23, 42, 0.04);
      margin-bottom: 16px;
    }

    .card-box .card-head {
      padding: 16px 20px;
      border-bottom: 1px solid #E2E8F0;
      font-weight: 700;
      color: #0F172A;
      font-size: 0.95rem;
      background-color: #FAFBFF;
      border-radius: 12px 12px 0 0;
    }

    .card-box .card-body-inner {
      padding: 20px;
    }

    .form-control, .form-select {
      color: #1e293b;
      background-color: #ffffff;
      border: 1px solid #CBD5E1;
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 0.9rem;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .form-control:focus, .form-select:focus {
      color: #0F172A;
      border-color: #2563EB;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

    .table thead th {
      background: linear-gradient(135deg, #0F172A, #1E3A5F);
      color: #f1f5f9;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 700;
      padding: 12px 14px;
    }

    .table tbody td {
      color: #334155;
      padding: 12px 14px;
      vertical-align: middle;
    }

    .badge-status-pending {
      background-color: #fff3cd;
      color: #664d03;
      padding: 4px 8px;
      border-radius: 4px;
      font-weight: 600;
    }

    .badge-status-proses {
      background-color: #cfe2ff;
      color: #052c65;
      padding: 4px 8px;
      border-radius: 4px;
      font-weight: 600;
    }

    .badge-status-selesai {
      background-color: #d1e7dd;
      color: #0a3622;
      padding: 4px 8px;
      border-radius: 4px;
      font-weight: 600;
    }

    .nik-error {
      display: none;
      color: #dc3545;
      font-weight: 700;
      font-size: 0.9rem;
      margin-top: 6px;
    }

    .nik-error.nik-error-show {
      display: block;
    }

    .nik-input-error {
      border-color: #dc3545 !important;
      box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    }

    .ai-error {
      display: none;
      color: #dc3545;
      font-weight: 600;
      font-size: 0.875rem;
      margin-top: 6px;
    }

    .ai-error.ai-error-show {
      display: block;
    }

    .preview-area {
      background-color: #e9ecef;
      border-radius: 8px;
      padding: 16px;
      max-height: 82vh;
      overflow: auto;
    }

  #suratPreviewBox {
      display: none;
    }

    #suratPreviewBox.surat-preview-visible {
      display: block;
    }

  #suratPdfHidden {
      position: fixed;
      left: -10000px;
      top: 0;
      width: 210mm;
      overflow: hidden;
      pointer-events: none;
      z-index: -9999;
      background: transparent;
      border: none;
      padding: 0;
      margin: 0;
    }

    /* Kontainer kertas A4 — dipakai pratinjau & ekspor PDF */
    .surat-kertas-a4 {
      font-family: "Times New Roman", Times, serif !important;
      width: 210mm !important;
      max-width: 210mm !important;
      min-height: 297mm;
      padding: 10mm 20mm 15mm 25mm;
      margin: 0;
      background: #ffffff !important;
      box-sizing: border-box !important;
      color: #000000 !important;
      font-size: 12pt;
      line-height: 1.45;
      overflow: hidden;
      word-wrap: break-word;
      overflow-wrap: break-word;
    }

    .surat-kertas-a4 *,
    .surat-kertas-a4 *::before,
    .surat-kertas-a4 *::after {
      font-family: "Times New Roman", Times, serif !important;
      box-sizing: border-box !important;
    }

    #suratA4Content.surat-kertas-a4 {
      margin: 0 auto;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
    }

    #elemenPdfSurat.surat-kertas-a4 {
      box-shadow: none !important;
      border: none !important;
      min-height: 297mm;
      height: 297mm;
      max-height: 297mm;
      padding: 10mm 20mm 15mm 25mm;
      overflow: hidden;
    }

    #elemenPdfSurat .kop-surat {
      margin-bottom: 10px;
      padding-bottom: 6px;
    }

    #elemenPdfSurat .surat-judul {
      margin: 10px 0 8px;
    }

    #elemenPdfSurat .surat-nomor {
      margin-bottom: 10px;
    }

    #elemenPdfSurat .surat-body-text p {
      margin-bottom: 8px;
    }

    #elemenPdfSurat .surat-ttd-block {
      margin-top: 20px;
    }

    #elemenPdfSurat .surat-ttd-block .ttd-jabatan {
      margin-bottom: 8px;
    }

    .kop-surat {
      text-align: center;
      border-bottom: 3px double #000000;
      padding-bottom: 8px;
      margin-bottom: 16px;
    }

    .kop-surat .line-sm {
      font-size: 11pt;
      font-weight: bold;
    }

    .kop-surat .line-md {
      font-size: 14pt;
      font-weight: bold;
      text-transform: uppercase;
      margin: 2px 0;
    }

    .kop-surat .line-lg {
      font-size: 16pt;
      font-weight: bold;
      text-transform: uppercase;
    }

    .kop-surat .line-address {
      font-size: 10pt;
      margin-top: 4px;
    }

    .kop-surat .line-contact {
      font-size: 9pt;
    }

    .surat-judul {
      text-align: center;
      font-weight: bold;
      text-decoration: underline;
      margin: 20px 0 16px;
      font-size: 13pt;
    }

    .surat-nomor {
      text-align: center;
      margin-bottom: 20px;
      font-size: 11pt;
    }

    .surat-body-text p {
      margin-bottom: 10px;
      text-align: justify;
    }

    .surat-body-text .indent {
      text-indent: 40px;
    }

    .surat-tabel-data {
      width: 100%;
      max-width: 100%;
      margin: 12px 0;
      border-collapse: collapse;
      table-layout: fixed;
    }

    .surat-tabel-data td {
      padding: 2px 6px 2px 0;
      vertical-align: top;
      word-wrap: break-word;
    }

    .surat-tabel-data td:first-child {
      width: 38%;
    }

    .surat-ttd-block {
      margin-top: 40px;
      text-align: right;
      padding-right: 0;
    }

    .surat-ttd-block .ttd-jabatan {
      margin-bottom: 8px;
    }

    .surat-ttd-block .ttd-center-wrap {
      text-align: center;
      display: inline-block;
      width: 250px;
    }

    .surat-ttd-block .ttd-gambar {
      width: 210px;
      height: auto;
      display: block;
      margin-top: -10px;
      margin-bottom: -15px;
      margin-left: auto;
      margin-right: auto;
      position: relative;
      z-index: 2;
    }

    .surat-ttd-block .ttd-nama {
      font-weight: bold;
      text-decoration: underline;
      margin-top: 0;
    }

    .admin-login-wrap {
      max-width: 420px;
      margin: 40px auto;
    }

    .admin-login-error {
      display: none;
      color: #dc3545;
      font-weight: 700;
      margin-top: 8px;
    }

    .admin-login-error.admin-login-error-show {
      display: block;
    }

    .gemini-status-box {
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 6px;
      border: 1px solid #dee2e6;
      background-color: #f8f9fa;
      color: #212529;
      font-size: 0.875rem;
    }

    .gemini-status-box.gemini-ok {
      background-color: #d1e7dd;
      border-color: #a3cfbb;
      color: #0a3622;
    }

    .status-select-admin {
      max-width: 160px;
      font-size: 0.875rem;
    }

    #toastNotif {
      position: fixed;
      bottom: 20px;
      right: 20px;
      z-index: 10000;
      min-width: 280px;
      max-width: 400px;
      padding: 14px 18px;
      border-radius: 8px;
      background-color: #ffffff;
      border: 2px solid #198754;
      color: #212529;
      font-weight: 600;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
      display: none;
    }

    #toastNotif.toast-visible {
      display: block;
    }

    #toastNotif.toast-error {
      border-color: #dc3545;
      color: #dc3545;
    }

    .btn-masuk-rt {
      font-weight: 600;
      font-size: 0.85rem;
      padding: 9px 16px;
      border-radius: 10px;
      border: 1.5px solid #2563EB;
      background-color: #ffffff;
      color: #2563EB;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease;
      font-family: "Inter", sans-serif;
    }

    .btn-masuk-rt:hover {
      background: linear-gradient(135deg, #2563EB, #4F46E5);
      border-color: transparent;
      color: #ffffff;
    }

    .btn-kembali-beranda {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 9px 18px;
      font-size: 0.875rem;
      font-weight: 600;
      color: #475569;
      background-color: #ffffff;
      border: 1.5px solid #CBD5E1;
      border-radius: 10px;
      cursor: pointer;
      text-decoration: none;
      transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
      font-family: "Inter", sans-serif;
    }

    .btn-kembali-beranda:hover {
      border-color: #2563EB;
      color: #2563EB;
      box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
    }

    .zona-label {
      display: inline-block;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      padding: 4px 10px;
      border-radius: 4px;
      margin-bottom: 12px;
    }

    .zona-label-warga {
      background-color: #cfe2ff;
      color: #052c65;
    }

    .zona-label-rt {
      background-color: #fff3cd;
      color: #664d03;
    }

    .zona-pak-rt-wrap {
      border-top: 3px solid #F59E0B;
      padding-top: 16px;
      margin-top: 8px;
    }

    .zona-warga-wrap {
      border-top: 3px solid #2563EB;
      padding-top: 16px;
    }

    @media print {
      body * {
        visibility: hidden;
      }
      #elemenPdfSurat, #elemenPdfSurat *,
      #suratA4Content, #suratA4Content * {
        visibility: visible;
      }
      #elemenPdfSurat, #suratA4Content {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm !important;
        max-width: 210mm !important;
        min-height: 297mm;
        margin: 0;
        padding: 10mm 20mm 15mm 25mm;
        box-shadow: none !important;
        font-family: "Times New Roman", Times, serif !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
      }
    }

    /* ============================================================
       LANDING PAGE STYLES
       ============================================================ */

    .zona-landing-wrap {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }

    /* Hero */
    .landing-hero {
      background: linear-gradient(135deg, #0a0f2c 0%, #0d2060 45%, #1a3a8f 100%);
      padding: 90px 0 80px;
      position: relative;
      overflow: hidden;
    }

    .landing-hero::before {
      content: '';
      position: absolute;
      top: -120px;
      right: -120px;
      width: 500px;
      height: 500px;
      background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
      border-radius: 50%;
      pointer-events: none;
    }

    .landing-hero::after {
      content: '';
      position: absolute;
      bottom: -80px;
      left: -80px;
      width: 350px;
      height: 350px;
      background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
      border-radius: 50%;
      pointer-events: none;
    }

    .landing-hero-inner {
      position: relative;
      z-index: 1;
      max-width: 780px;
    }

    .landing-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(255,255,255,0.10);
      border: 1px solid rgba(255,255,255,0.18);
      color: #93c5fd;
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      padding: 6px 14px;
      border-radius: 999px;
      margin-bottom: 28px;
      backdrop-filter: blur(8px);
    }

    .landing-headline {
      font-size: clamp(2.2rem, 5vw, 3.4rem);
      font-weight: 900;
      color: #ffffff;
      line-height: 1.12;
      margin-bottom: 20px;
      letter-spacing: -0.02em;
    }

    .landing-headline-accent {
      background: linear-gradient(90deg, #60a5fa, #a78bfa);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .landing-subheadline {
      font-size: 1.05rem;
      color: #cbd5e1;
      max-width: 580px;
      line-height: 1.7;
      margin-bottom: 40px;
      font-weight: 400;
    }

    .landing-cta-group {
      display: flex;
      flex-wrap: wrap;
      gap: 14px;
    }

    .btn-landing-primary {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      background: linear-gradient(135deg, #3b82f6, #6366f1);
      color: #fff;
      font-size: 1rem;
      font-weight: 700;
      padding: 15px 28px;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      transition: transform 0.18s ease, box-shadow 0.18s ease;
      box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
      font-family: "Inter", sans-serif;
    }

    .btn-landing-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 28px rgba(59, 130, 246, 0.55);
    }

    .btn-landing-secondary {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      background: rgba(255,255,255,0.08);
      color: #e2e8f0;
      font-size: 1rem;
      font-weight: 600;
      padding: 15px 28px;
      border: 1.5px solid rgba(255,255,255,0.22);
      border-radius: 12px;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
      backdrop-filter: blur(6px);
      font-family: "Inter", sans-serif;
    }

    .btn-landing-secondary:hover {
      background: rgba(255,255,255,0.15);
      border-color: rgba(255,255,255,0.4);
      transform: translateY(-2px);
      color: #fff;
    }

    /* Features */
    .landing-features {
      padding: 72px 16px;
      background: #ffffff;
    }

    .landing-features-label {
      text-align: center;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: #6366f1;
      margin-bottom: 40px;
    }

    .feature-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 32px 28px;
      height: 100%;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    }

    .feature-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 12px 32px rgba(0,0,0,0.10);
    }

    .feature-icon {
      width: 52px;
      height: 52px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.4rem;
      margin-bottom: 18px;
    }

    .feature-icon-blue { background: #eff6ff; color: #2563eb; }
    .feature-icon-orange { background: #fff7ed; color: #ea580c; }
    .feature-icon-green { background: #f0fdf4; color: #16a34a; }

    .feature-title {
      font-size: 1.05rem;
      font-weight: 700;
      color: #111827;
      margin-bottom: 10px;
    }

    .feature-desc {
      font-size: 0.9rem;
      color: #6b7280;
      line-height: 1.65;
      margin-bottom: 0;
    }

    /* Footer Landing */
    .landing-footer {
      background: #0f172a;
      padding: 40px 0;
      margin-top: auto;
    }

    .landing-footer-inner { text-align: center; }

    .landing-footer-brand {
      font-size: 1.1rem;
      font-weight: 800;
      color: #f1f5f9;
      margin-bottom: 6px;
    }

    .landing-footer-tagline {
      font-size: 0.85rem;
      color: #94a3b8;
      margin-bottom: 10px;
    }

    .landing-footer-copy {
      font-size: 0.78rem;
      color: #475569;
      margin-bottom: 0;
    }

    @media (max-width: 576px) {
      .landing-hero { padding: 60px 0 56px; }
      .btn-landing-primary,
      .btn-landing-secondary {
        width: 100%;
        justify-content: center;
      }
      .landing-cta-group { flex-direction: column; }
    }