/* ============================================================
   SIPATEN - Main Stylesheet
   Font: Outfit (display) + Plus Jakarta Sans (body)
   Color: Deep Navy + Gold accent (profesional pemerintahan)
   ============================================================ */

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

:root {
  --primary:      #1a3a5c;
  --primary-dark: #102540;
  --primary-light:#2558a3;
  --accent:       #c9a227;
  --accent-light: #f0c94d;
  --success:      #16a34a;
  --danger:       #dc2626;
  --warning:      #d97706;
  --info:         #0891b2;
  --gray-50:      #f8fafc;
  --gray-100:     #f1f5f9;
  --gray-200:     #e2e8f0;
  --gray-300:     #cbd5e1;
  --gray-400:     #94a3b8;
  --gray-500:     #64748b;
  --gray-600:     #475569;
  --gray-700:     #334155;
  --gray-800:     #1e293b;
  --gray-900:     #0f172a;
  --white:        #ffffff;
  --sidebar-w:    260px;
  --header-h:     64px;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.14);
  --transition:   all .22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* FIX: font body pakai Plus Jakarta Sans, bukan Times New Roman */
body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* FIX: hapus override Times New Roman yang merusak seluruh UI */

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; font-weight: 700; line-height: 1.2; }
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ---- LANDING / PORTAL PAGE ---- */
.portal-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.portal-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,162,39,.15) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.portal-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,162,39,.10) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  border-radius: 50%;
}

.portal-card {
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 560px;
  width: 100%;
  position: relative;
  z-index: 1;
  animation: fadeSlideUp .6s ease both;
}

.portal-logo {
  width: 120px; height: 110px;
  background: var(--white);
  border-radius: 10%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.portal-logo img { width: 100px; height: 100px; object-fit: contain; }

.portal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: .25rem;
  letter-spacing: -.02em;
}

.portal-subtitle {
  color: rgba(255,255,255,.7);
  font-size: .95rem;
  margin-bottom: 2.5rem;
}

.portal-divider {
  width: 48px; height: 3px;
  background: var(--accent);
  margin: .75rem auto 2rem;
  border-radius: 2px;
}

.portal-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.portal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 1.4rem 2rem;
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  min-width: 130px;
  text-decoration: none;
}

.portal-btn:hover {
  background: rgba(255,255,255,.22);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.2);
  color: var(--white);
}

.portal-btn .btn-icon { font-size: 1.8rem; }

.portal-btn.btn-masyarakat {
  background: var(--white);
  border-color: var(--white);
  color: var(--primary);
}

.portal-btn.btn-masyarakat:hover {
  background: var(--gray-100);
  border-color: var(--gray-100);
  color: var(--primary);
}

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 900px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  animation: fadeSlideUp .5s ease both;
}

.login-side {
  background: linear-gradient(160deg, var(--primary), var(--primary-light));
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

.login-side-logo { width: 80px; height: 80px; margin: 0 auto 1.5rem; }
.login-side-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-side h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }
.login-side p { opacity: .8; font-size: .9rem; }

.login-form-wrap { padding: 2.5rem 2rem; }
.login-form-wrap h3 { font-size: 1.3rem; color: var(--primary); margin-bottom: 1.5rem; }

/* ---- FORM CONTROLS ---- */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-weight: 600; color: var(--gray-700); margin-bottom: .4rem; font-size: .875rem; }
.form-control {
  display: block;
  width: 100%;
  padding: .65rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,88,163,.12); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 1.25em; padding-right: 2.5rem; }

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

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary   { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-accent    { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-light); color: var(--gray-900); }
.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-light     { background: var(--gray-100); color: var(--gray-700); }
.btn-light:hover { background: var(--gray-200); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: .25em .65em;
  border-radius: 20px;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
}
.badge-success      { background: #dcfce7; color: #15803d; }
.badge-warning      { background: #fef9c3; color: #a16207; }
.badge-danger       { background: #fee2e2; color: #b91c1c; }
.badge-info         { background: #e0f2fe; color: #0369a1; }
.badge-dark         { background: #f1f5f9; color: #334155; }
.badge-secondary    { background: var(--gray-200); color: var(--gray-600); }

/* ---- ADMIN LAYOUT ---- */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
  color: var(--white);
}

.sidebar-brand-logo {
  width: 40px; height: 40px;
  border-radius: 6px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand-logo img { width: 100%; height: 100%; object-fit: contain; }

.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-text strong { display: block; font-family: 'Outfit', sans-serif; font-size: .95rem; }
.sidebar-brand-text span { font-size: .72rem; opacity: .65; }

.sidebar-nav { padding: 1rem .75rem; flex: 1; }
.sidebar-section-label { font-size: .7rem; font-weight: 600; opacity: .5; letter-spacing: .08em; text-transform: uppercase; padding: .75rem .5rem .35rem; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  font-weight: 500;
  font-size: .875rem;
  margin-bottom: .15rem;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.sidebar-link.active { background: var(--accent); color: var(--white); font-weight: 600; }
.sidebar-link .icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-name { font-weight: 600; font-size: .85rem; line-height: 1.2; }
.sidebar-user-role { font-size: .72rem; opacity: .6; }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header */
.top-header {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.page-title { font-size: 1.1rem; font-weight: 700; color: var(--primary); flex: 1; }

.top-header-actions { display: flex; align-items: center; gap: .75rem; }

/* Content Area */
.content-area { padding: 1.5rem; flex: 1; }

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.card-body { padding: 1.25rem; }
.card-footer { padding: .75rem 1.25rem; background: var(--gray-50); border-top: 1px solid var(--gray-100); }

/* Stat Cards */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-label { font-size: .8rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-family: 'Outfit', sans-serif; font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-icon { font-size: 1.5rem; }
.stat-card-row { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-trend { font-size: .75rem; color: var(--gray-400); margin-top: .25rem; }

.stat-primary { border-top: 3px solid var(--primary); }
.stat-success { border-top: 3px solid var(--success); }
.stat-warning { border-top: 3px solid var(--warning); }
.stat-danger  { border-top: 3px solid var(--danger); }
.stat-info    { border-top: 3px solid var(--info); }

/* ---- TABLES ---- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .75rem 1rem;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ---- ALERTS ---- */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  position: relative;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.alert-dismissible .btn-close { margin-left: auto; background: none; border: none; font-size: 1.1rem; cursor: pointer; opacity: .6; }

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: .35rem;
  justify-content: center;
  padding: 1rem 0;
}
.page-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---- SEARCH / FILTER BAR ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.search-box {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.search-box input {
  border: none;
  outline: none;
  padding: .55rem .9rem;
  font-size: .875rem;
  font-family: inherit;
  flex: 1;
  background: transparent;
}
.search-box-icon { padding: 0 .75rem; color: var(--gray-400); font-size: 1rem; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeSlideUp .3s ease;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--gray-400); transition: var(--transition); }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: .75rem; }

/* ---- MASYARAKAT (PUBLIC) LAYOUT ---- */
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26,58,92,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: .75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.pub-nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--white);
}

.pub-nav-brand-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  overflow: hidden;
}
.pub-nav-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.pub-nav-brand-text strong { display: block; font-family: 'Outfit', sans-serif; font-size: .9rem; color: var(--white); }
.pub-nav-brand-text small { font-size: .7rem; color: rgba(255,255,255,.6); }

.pub-nav-links { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.pub-nav-link {
  padding: .45rem 1rem;
  border-radius: 8px;
  color: rgba(255,255,255,.8);
  font-weight: 500;
  font-size: .875rem;
  transition: var(--transition);
  text-decoration: none;
}
.pub-nav-link:hover, .pub-nav-link.active { background: rgba(255,255,255,.12); color: var(--white); }

.pub-nav-logout {
  padding: .4rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  font-size: .875rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}
.pub-nav-logout:hover { background: var(--accent-light); color: var(--gray-900); }

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  padding: 5rem 2rem 4rem;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  right: -5%;
  top: -20%;
  width: 50%;
  height: 150%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Ccircle cx='200' cy='200' r='180' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='40'/%3E%3Ccircle cx='200' cy='200' r='120' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='30'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}
.hero-container { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-label { display: inline-flex; align-items: center; gap: .4rem; background: rgba(201,162,39,.2); color: var(--accent-light); padding: .3rem .8rem; border-radius: 20px; font-size: .8rem; font-weight: 600; margin-bottom: 1rem; border: 1px solid rgba(201,162,39,.3); }
.hero h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; letter-spacing: -.03em; }
.hero p { color: rgba(255,255,255,.75); font-size: 1rem; margin-bottom: 1.75rem; line-height: 1.7; }
.hero-btns { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-img { display: flex; align-items: center; justify-content: center; }
.hero-visual {
  width: 100%;
  max-width: 360px;
  height: 260px;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

/* Section */
.section { padding: 4rem 2rem; }
.section-container { max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-label { font-size: .8rem; font-weight: 700; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }
.section-title { font-size: 2rem; color: var(--primary); font-weight: 800; }
.section-desc { color: var(--gray-500); font-size: .95rem; max-width: 520px; margin: .5rem auto 0; }

/* Jenis Surat Cards */
.surat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.surat-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
  cursor: pointer;
}
.surat-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow); transform: translateY(-3px); }
.surat-card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.surat-card h4 { font-size: 1rem; color: var(--primary); margin-bottom: .35rem; }
.surat-card p { font-size: .8rem; color: var(--gray-500); line-height: 1.5; margin-bottom: .75rem; }
.surat-card a { font-size: .8rem; color: var(--primary-light); font-weight: 600; }

/* Alur Steps */
.alur-steps { display: flex; gap: 0; flex-wrap: wrap; }
.alur-step { flex: 1; min-width: 150px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 1rem; position: relative; }
.alur-step:not(:last-child)::after { content: '→'; position: absolute; right: -1rem; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--gray-400); }
.alur-step-num { width: 44px; height: 44px; background: var(--primary); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.1rem; margin-bottom: .75rem; }
.alur-step h5 { font-size: .875rem; font-weight: 700; color: var(--primary); margin-bottom: .3rem; }
.alur-step p { font-size: .78rem; color: var(--gray-500); }

/* Syarat Berkas */
.syarat-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.syarat-tab {
  padding: .4rem .9rem;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-600);
}
.syarat-tab:hover, .syarat-tab.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.syarat-content { display: none; }
.syarat-content.show { display: block; }
.syarat-list { list-style: none; }
.syarat-list li { padding: .5rem 0; border-bottom: 1px solid var(--gray-100); display: flex; gap: .5rem; align-items: flex-start; font-size: .875rem; }
.syarat-list li:last-child { border-bottom: none; }
.syarat-list li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* Cek Status */
.cek-berkas-form { background: var(--accent); border-radius: var(--radius-lg); padding: 2rem; }
.cek-berkas-form label { color: var(--white); font-weight: 700; font-size: 1.1rem; }
.cek-berkas-input-row { display: flex; gap: 1rem; margin-top: .75rem; }
.cek-berkas-input-row input { flex: 1; padding: .8rem 1.25rem; border: none; border-radius: var(--radius); font-size: 1rem; outline: none; }
.status-result-card { margin-top: 1.5rem; background: var(--white); border-radius: var(--radius); padding: 1.5rem; }

/* Footer */
.pub-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 2rem 1.5rem;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand-logo {
  width: 48px; height: 48px;
  background: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
  overflow: hidden;
}
.footer-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.footer h4 {
  font-size: .95rem;
  font-weight: 700;
  color: #ffffff !important;
  margin-bottom: .75rem;
}
.footer p, .footer a, .footer span, .footer div {
  font-size: .8rem;
  line-height: 1.7;
  color: rgba(255,255,255,.8) !important;
  text-decoration: none;
  display: block;
  margin-bottom: .3rem;
}
.footer a:hover { color: var(--accent-light) !important; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1.25rem;
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.6) !important;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---- GRID HELPERS ---- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-sm     { font-size: .8rem; }
.text-xs     { font-size: .75rem; }
.fw-bold     { font-weight: 700; }
.w-100       { width: 100%; }

.hidden { display: none !important; }

/* ---- CETAK SURAT (PRINT AREA) ---- */
.surat-print-wrapper { background: var(--white); padding: 2rem; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.surat-kop { display: flex; align-items: center; gap: 1rem; border-bottom: 3px solid var(--primary); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.surat-kop-logo { width: 80px; height: 80px; object-fit: contain; }
.surat-kop-text { flex: 1; text-align: center; }
.surat-kop-text h2 { font-size: 1.1rem; font-weight: 800; color: var(--primary); text-transform: uppercase; }
.surat-kop-text p { font-size: .8rem; color: var(--gray-600); }
.surat-kop-logo2 { width: 80px; height: 80px; object-fit: contain; }
.surat-nomor { text-align: center; margin-bottom: 2rem; }
.surat-nomor h3 { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.surat-body { font-size: .9rem; line-height: 2; color: var(--gray-800); }
.surat-body p { margin-bottom: .5rem; }
.surat-ttd-area { margin-top: 2.5rem; display: flex; justify-content: flex-end; }
.surat-ttd-box { text-align: center; min-width: 200px; }
.surat-ttd-box p { font-size: .85rem; margin-bottom: .5rem; }
.surat-ttd-img { width: 120px; height: 60px; object-fit: contain; display: block; margin: .5rem auto; }
.surat-cap-img { width: 80px; height: 80px; object-fit: contain; position: absolute; bottom: 10px; left: 20px; opacity: .85; }
.surat-nama-camat { font-weight: 700; font-size: .9rem; }
.surat-nip { font-size: .8rem; color: var(--gray-600); }

/* ---- ANIMATIONS ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---- HAMBURGER (mobile) ---- */
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray-600); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-container { grid-template-columns: 1fr; }
  .hero-img { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
  .login-container { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .portal-buttons { flex-direction: column; align-items: center; }

  /* FIX: tombol portal di mobile teks dan warna terbaca */
  .portal-btn {
    background: rgba(255,255,255,.15);
    border: 1.5px solid rgba(255,255,255,.4);
    color: var(--white);
  }
  .portal-btn.btn-masyarakat {
    background: var(--white);
    border-color: var(--white);
    color: var(--primary);
  }

  .alur-steps { flex-direction: column; }
  .alur-step::after { display: none; }
  .pub-nav { padding: .75rem 1rem; }
  .pub-nav-links { gap: .1rem; }
  .pub-nav-link { padding: .35rem .6rem; font-size: .8rem; }
  .content-area { padding: 1rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .cek-berkas-input-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .portal-card { padding: 2rem 1.25rem; }
  .portal-title { font-size: 1.3rem; }
  .section { padding: 2.5rem 1rem; }
  .top-header { padding: 0 1rem; }
}

/* ---- PRINT MEDIA ---- */
@media print {
  .sidebar, .top-header, .filter-bar, .btn, .pub-nav, .pub-footer { display: none !important; }
  .main-content { margin-left: 0; }
  .surat-print-wrapper { border: none; padding: 0; }
  /* FIX: background putih saat print, bukan warna aneh */
  body { background: white !important; }
}

@page {
  size: A4 portrait;
  margin: 1.5cm 1.5cm 1.5cm 1.5cm;
}