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

:root {
  --bg-color: #f4f5f7;
  --bg-gradient: radial-gradient(circle at top right, #ffffff, #eaecef);
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: rgba(0, 0, 0, 0.08);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --jkk-color: #1e40af; /* Deep Blue from image */
  --jkk-bg: rgba(30, 64, 175, 0.1);
  --jkm-color: #334155; /* Slate */
  --jkm-bg: rgba(51, 65, 85, 0.1);
  --jht-color: #8fa08e; /* Sage green from image */
  --jht-bg: rgba(143, 160, 142, 0.15);
  --jp-color: #64748b; /* Neutral slate */
  --jp-bg: rgba(100, 116, 139, 0.1);
  --primary-color: #2563eb; /* Primary Blue */
  --primary-bg: rgba(37, 99, 235, 0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  background: var(--bg-gradient);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

::placeholder {
  color: #94a3b8;
  opacity: 1;
}

/* Header */
.site-header {
  position: relative;
  padding: 0;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.header-bg-shapes {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: -1;
}

.shape {
  position: absolute;
  filter: blur(60px);
  opacity: 0.4;
}

.shape-1 {
  top: -50px; left: -50px;
  width: 200px; height: 200px;
  background: var(--primary-color);
}

.shape-2 {
  bottom: -50px; right: 20%;
  width: 300px; height: 300px;
  background: var(--jkm-color);
}

.shape-3 {
  top: 20%; right: -50px;
  width: 250px; height: 250px;
  background: var(--jht-color);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-icon {
  /* background: rgba(255, 255, 255, 0.95); */
  padding: 6px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon img {
  height: 70px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
}

.logo-icon svg {
  display: none;
}

.logo-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-title .accent {
  color: var(--primary-color);
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.header-badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-jkk { background: var(--jkk-bg); color: var(--jkk-color); border-color: rgba(249, 115, 22, 0.2); }
.badge-jkm { background: var(--jkm-bg); color: var(--jkm-color); border-color: rgba(168, 85, 247, 0.2); }
.badge-jht { background: var(--jht-bg); color: var(--jht-color); border-color: rgba(34, 197, 94, 0.2); }
.badge-jp { background: var(--jp-bg); color: var(--jp-color); border-color: rgba(244, 63, 94, 0.2); }

.header-hero-text {
  text-align: center;
  padding: 3rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.header-hero-text h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(to right, #2563eb, #1e40af, #8fa08e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-hero-text p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.card-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.step-badge {
  width: 40px; height: 40px;
  background: var(--primary-bg);
  color: var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.section-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Forms */
.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.form-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input, .form-group select {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
  max-width: 100%;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-bg);
}

/* Iuran Rates */
.iuran-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rate-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.rate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 4px;
}

.rate-card.rate-jkk::before { background: var(--jkk-color); }
.rate-card.rate-jkm::before { background: var(--jkm-color); }
.rate-card.rate-jht::before { background: var(--jht-color); }
.rate-card.rate-jp::before { background: var(--jp-color); }

.rate-icon {
  font-size: 1.5rem;
}

.rate-info {
  display: flex; flex-direction: column;
}

.rate-label { font-weight: 600; font-size: 0.875rem; }
.rate-sub { font-size: 0.75rem; color: var(--text-secondary); }

.rate-input-wrap {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.rate-input-wrap input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 700;
  width: 100%;
  outline: none;
}

.rate-unit {
  color: var(--text-secondary);
  font-weight: 600;
  margin-left: 0.5rem;
}

.total-rate-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--primary-bg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.total-rate-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

th {
  background: #f1f5f9;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td input {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: var(--text-primary);
  width: 100%;
  outline: none;
}

td input:focus {
  border-color: var(--primary-color);
}

.row-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: #e2e8f0;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.row-total {
  font-weight: 700;
  color: var(--primary-color);
}

tfoot td {
  background: #f1f5f9;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-hitung {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  border-radius: 9999px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-hitung:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.jabatan-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.hitung-btn-wrapper {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

/* Results Section */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sc-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.sc-label { font-size: 0.875rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; }
.sc-value { font-size: 1.5rem; font-weight: 800; }
.sc-sub { font-size: 0.75rem; color: var(--text-muted); }

.sc-total .sc-value { color: var(--primary-color); }
.sc-jkk .sc-value { color: var(--jkk-color); }
.sc-jkm .sc-value { color: var(--jkm-color); }
.sc-jht .sc-value { color: var(--jht-color); }
.sc-jp .sc-value { color: var(--jp-color); }

/* Result Table */
.result-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--primary-bg);
}

.cell-jkk { color: var(--jkk-color); }
.cell-jkm { color: var(--jkm-color); }
.cell-jht { color: var(--jht-color); }
.cell-jp { color: var(--jp-color); }
.cell-total { color: var(--primary-color); font-weight: 800; }

/* Manfaat Cards */
.manfaat-card {
  position: relative;
  overflow: hidden;
}

.manfaat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 4px;
}

.manfaat-jkk::before { background: var(--jkk-color); }
.manfaat-jkm::before { background: var(--jkm-color); }
.manfaat-jht::before { background: var(--jht-color); }
.manfaat-jp::before { background: var(--jp-color); }

.manfaat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.manfaat-badge-big {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
}

.manfaat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.manfaat-grid-single {
  grid-template-columns: 1fr;
}

.manfaat-group {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.manfaat-group-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

.manfaat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.875rem;
}

.manfaat-item:last-child { border: none; }

.manfaat-item .val {
  font-weight: 600;
}

.accent-jkk { color: var(--jkk-color) !important; }
.accent-jkm { color: var(--jkm-color) !important; }
.accent-jht { color: var(--jht-color) !important; }
.accent-jp { color: var(--jp-color) !important; }

.highlight-item {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  border: none;
}

.jht-sim-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: #ffffff;
}

.td-jht { color: var(--jht-color); font-weight: 700; }

/* PDF Buttons */
.pdf-btn-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-pdf {
  background: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  border-radius: 9999px;
}

.btn-pdf:hover {
  background: #0284c7;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .result-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .manfaat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .form-grid-3 { grid-template-columns: 1fr; }
  .iuran-rate-grid { grid-template-columns: 1fr; }
  .result-summary-grid { grid-template-columns: 1fr; }
  .header-content { flex-direction: column; gap: 1rem; }
  .header-badges { display: none; }
  .pdf-btn-wrapper { flex-direction: column; }
}

@media print {
  body { background: white; color: black; }
  .site-header, .jabatan-actions, .hitung-btn-wrapper, .pdf-btn-wrapper, #page-welcome { display: none; }
  .card { border: 1px solid #ccc; box-shadow: none; background: transparent; }
}

/* ==================== WELCOME PAGE ==================== */
#page-welcome {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

.welcome-bg-shapes {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  overflow: hidden;
}

.wshape {
  position: absolute;
  filter: blur(80px);
  opacity: 0.3;
  border-radius: 50%;
}

.wshape-1 { top: -10%; left: -10%; width: 500px; height: 500px; background: var(--primary-color); }
.wshape-2 { bottom: -10%; right: -10%; width: 600px; height: 600px; background: var(--jht-color); }
.wshape-3 { top: 40%; left: 60%; width: 400px; height: 400px; background: var(--jkm-color); }

.welcome-logo { margin-bottom: 2rem; }

.welcome-hero {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 800px;
}

.welcome-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.welcome-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* ==================== LOGOUT BUTTON ==================== */
.btn-logout-floating {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.btn-logout-floating:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-logout-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-logout-header:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* ==================== LOGIN & REGISTER PAGE ==================== */
#page-login, #page-register {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  z-index: 10;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.login-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.program-cards {
  display: flex;
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.program-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 340px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.program-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border-color: rgba(0, 0, 0, 0.1);
}

.program-pu:hover { border-color: var(--primary-color); }

.program-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.program-card-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--primary-bg);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.program-badge-soon {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.2);
}

.program-card-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.program-pu .program-card-title { color: var(--primary-color); }

.program-card-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.program-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.program-card-covers {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.program-card-covers span {
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.program-card-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  width: 100%;
}

.program-card-btn:hover { background: #0284c7; }

.program-card-disabled {
  opacity: 0.6;
  filter: grayscale(0.5);
}

.program-card-disabled:hover {
  transform: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  border-color: var(--card-border);
}

.program-btn-disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: not-allowed;
}

.welcome-footer {
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ==================== BUTTON KEMBALI ==================== */
.btn-kembali {
  background: #f8fafc;
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  margin-right: 1.5rem;
}

.btn-kembali:hover {
  background: #f1f5f9;
}

.logo-area {
  display: flex;
  align-items: center;
}

/* ==================== UPLOAD AREA ==================== */
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: var(--primary-bg);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.upload-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.upload-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-preview {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
}

.file-preview img {
  width: 100%; height: 100%; object-fit: cover;
}

.file-name { font-weight: 600; font-size: 0.875rem; }
.file-size { font-size: 0.75rem; color: var(--text-secondary); }
.file-remove {
  background: transparent; border: none;
  color: #ef4444; cursor: pointer;
  padding: 0.25rem; border-radius: var(--radius-sm);
}
.file-remove:hover { background: rgba(239, 68, 68, 0.1); }

/* ==================== JAKON STYLES ==================== */
.program-jakon .program-card-title { color: #22c55e; }
.program-jakon:hover { border-color: #22c55e; }
.program-jakon .program-card-badge { background: rgba(34,197,94,0.1); color: #22c55e; border-color: rgba(34,197,94,0.2); }

.result-icon-blue {
  color: var(--primary-color);
  background: var(--primary-bg);
}

.tfoot-total td {
  background: rgba(0,0,0,0.25);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.font-bold { font-weight: 700; }

/* ==================== FORMULIR DOWNLOAD SECTION ==================== */
.formulir-section {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}

.formulir-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.formulir-section-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

.formulir-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.formulir-group {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.formulir-group:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.formulir-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
}

/* Per-program accent borders */
.formulir-pu { border-top: 3px solid var(--primary-color); }
.formulir-bpu { border-top: 3px solid var(--jkm-color); }
.formulir-jakon { border-top: 3px solid var(--jht-color); }

.formulir-pu .formulir-group-title { color: var(--primary-color); }
.formulir-bpu .formulir-group-title { color: var(--jkm-color); }
.formulir-jakon .formulir-group-title { color: var(--jht-color); }

.formulir-group-icon { font-size: 1.75rem; }

.formulir-group-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.formulir-group-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.formulir-list {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.formulir-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
  cursor: pointer;
}

.formulir-item:last-child { border-bottom: none; }

.formulir-item:hover {
  background: rgba(255,255,255,0.06);
}

.formulir-item-icon { font-size: 1.1rem; flex-shrink: 0; }

.formulir-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.formulir-item-name {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.formulir-item-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.formulir-item-dl {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-secondary);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  transition: background 0.15s, color 0.15s;
}

.formulir-item:hover .formulir-item-dl {
  background: rgba(14,165,233,0.15);
  color: var(--primary-color);
}

.formulir-pu .formulir-item:hover .formulir-item-dl { color: var(--primary-color); background: var(--primary-bg); }
.formulir-bpu .formulir-item:hover .formulir-item-dl { color: var(--jkm-color); background: var(--jkm-bg); }
.formulir-jakon .formulir-item:hover .formulir-item-dl { color: var(--jht-color); background: var(--jht-bg); }

@media (max-width: 900px) {
  .formulir-grid { grid-template-columns: 1fr; }
}

/* ==================== RESPONSIVE MOBILE ==================== */
@media (max-width: 768px) {

  /* --- Header & Logo --- */
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .logo-area {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .logo-icon img { height: 50px; }
  .header-badges { flex-wrap: wrap; gap: 0.375rem; }
  .header-hero-text { padding: 1.5rem 1rem; }
  .header-hero-text h1 { font-size: 1.65rem; }
  .btn-kembali { font-size: 0.8rem; padding: 0.4rem 0.85rem; }

  /* --- Welcome Page --- */
  .welcome-logo { gap: 12px; flex-wrap: wrap; }
  .welcome-logo .logo-icon img { height: 45px; }
  .welcome-hero h1 { font-size: 1.75rem; }
  .welcome-hero p { font-size: 0.85rem; padding: 0 1rem; }
  .program-cards {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
  }
  .program-card {
    width: 100%;
    max-width: 350px;
    padding: 1.75rem 1.25rem;
  }
  .formulir-grid { grid-template-columns: 1fr; }
  .formulir-section { padding: 0 1rem; }

  /* --- Main Container --- */
  .main-container { padding: 0 0.75rem 3rem; gap: 1rem; }
  .card { padding: 1rem; border-radius: var(--radius-lg); }

  /* --- Form Grids --- */
  .form-grid-3 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .iuran-rate-grid { grid-template-columns: repeat(2, 1fr); }

  /* --- Table wrapper --- */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 0.6rem 0.5rem; font-size: 0.78rem; }
  th { font-size: 0.7rem; }

  /* --- Jabatan table inputs --- */
  td input { font-size: 0.8rem; padding: 0.35rem; min-width: 80px; }

  /* --- Jabatan actions --- */
  .jabatan-actions { flex-direction: column; }
  .jabatan-actions .btn { width: 100%; justify-content: center; }

  /* --- Hitung button --- */
  .hitung-btn-wrapper { padding: 0 0.75rem; }
  .btn-hitung { width: 100%; font-size: 1rem; padding: 0.875rem 1.5rem; }

  /* --- Result Summary Grid --- */
  .result-summary-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .result-summary-grid .sc-total {
    grid-column: 1 / -1;
  }
  .sc-value { font-size: 1.1rem !important; }

  /* --- Manfaat Cards --- */
  .manfaat-grid { grid-template-columns: 1fr !important; gap: 0.75rem; }
  .manfaat-header { flex-direction: row; align-items: center; gap: 0.75rem; }
  .manfaat-badge-big { width: 44px; height: 44px; font-size: 1rem; flex-shrink: 0; }
  .manfaat-group { padding: 0.875rem; }
  .manfaat-item { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .manfaat-item .val { font-size: 0.8rem; }
  .manfaat-item span:first-child { font-size: 0.8rem; }

  /* --- PDF Buttons --- */
  .pdf-btn-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
    padding: 0 0.25rem;
  }
  .pdf-btn-wrapper .btn { width: 100%; justify-content: center; }

  /* --- Rate Cards --- */
  .iuran-rate-grid .rate-card { padding: 0.75rem; }

  /* --- Section title --- */
  .section-title { font-size: 1rem; }
  .card-header-row { gap: 0.75rem; padding-bottom: 0.75rem; margin-bottom: 1rem; }

  /* --- Upload area --- */
  .upload-area { padding: 1.25rem 1rem; }

  /* --- JHT Sim table --- */
  .jht-sim-table-wrap { font-size: 0.78rem; }
}

@media (max-width: 480px) {
  /* Extra small — phone portrait */
  .header-hero-text h1 { font-size: 1.4rem; }
  .iuran-rate-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .result-summary-grid { grid-template-columns: 1fr 1fr !important; }
  .summary-card { padding: 0.875rem; }
  .sc-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
  .sc-label { font-size: 0.7rem; }
  .sc-value { font-size: 1rem !important; }

  .manfaat-badge-big { width: 38px; height: 38px; font-size: 0.875rem; }
  .section-title { font-size: 0.95rem; }
  .section-desc { font-size: 0.78rem; }

  th, td { padding: 0.45rem 0.4rem; font-size: 0.72rem; }

  .formulir-group-icon { font-size: 1.4rem; }
  .formulir-group-title { font-size: 0.85rem; }
  .formulir-item { padding: 0.6rem 0.9rem; }
  .formulir-item-name { font-size: 0.78rem; }
  .formulir-item-desc { font-size: 0.65rem; }

  .btn-logout-floating {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
  }
}

/* ==================== WELCOME USER BAR ==================== */
.welcome-user-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem auto 0;
  max-width: 800px;
  padding: 1.25rem 1.5rem;
  background: rgba(14, 165, 233, 0.07);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-lg);
  animation: fadeInUp 0.5s ease;
}
.welcome-greeting {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
}
.welcome-greeting strong {
  color: var(--primary-color);
}

/* ==================== ADMIN & RIWAYAT PAGES ==================== */
#page-admin, #page-riwayat {
  min-height: 100vh;
  position: relative;
  padding: 2rem 1rem 4rem;
}
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding-top: 3rem;
}
.admin-header {
  margin-bottom: 2rem;
}
.admin-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}
.admin-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.admin-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.admin-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 0.75rem;
}
.admin-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.admin-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}
.admin-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}
.admin-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--card-border);
}
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table thead th {
  background: #f1f5f9;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 0.7rem 0.85rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.15s ease;
}
.admin-table tbody tr:hover {
  background: rgba(0,0,0,0.02);
}
.admin-table td {
  padding: 0.75rem 0.85rem;
  color: var(--text-primary);
  vertical-align: middle;
}
.badge-program {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-pu { background: rgba(14,165,233,0.15); color: #0ea5e9; }
.badge-bpu { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-jakon { background: rgba(249,115,22,0.15); color: #f97316; }

/* ==================== RIWAYAT LIST ==================== */
.riwayat-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.riwayat-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  font-style: italic;
}
.riwayat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: transform 0.2s, box-shadow 0.2s;
}
.riwayat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.riwayat-card-info { flex: 1; min-width: 180px; }
.riwayat-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.riwayat-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.riwayat-card-total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-color);
  white-space: nowrap;
}

/* ==================== FILTER BAR ==================== */
.riwayat-filter-bar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}
.riwayat-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.riwayat-filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-input {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}
.filter-input:focus { outline: none; border-color: var(--primary-color); }
.filter-input option { background: #ffffff; color: var(--text-primary); }

/* ==================== ADMIN PROGRAM FILTER BUTTONS ==================== */
.admin-program-filter {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.admin-prog-btn {
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.admin-prog-btn:hover { background: rgba(14,165,233,0.1); border-color: var(--primary-color); color: var(--primary-color); }
.admin-prog-btn.active { background: rgba(14,165,233,0.15); border-color: var(--primary-color); color: var(--primary-color); }

/* ==================== PDF DOWNLOAD BUTTON ==================== */
.btn-pdf-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.3);
  border-radius: var(--radius-sm);
  color: #f43f5e;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-pdf-dl:hover { background: rgba(244,63,94,0.2); border-color: #f43f5e; }

/* ==================== ROLE SELECT ==================== */
.role-select {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
}
.role-select option { background: #ffffff; }

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
  /* Prevent table squeeze */
  .admin-table th, .admin-table td {
    white-space: nowrap;
    padding: 0.5rem;
    font-size: 0.75rem;
  }
  
  /* Fix overflow issues on containers */
  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
  }
  
  /* Fix riwayat card overflow */
  .riwayat-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
  }
  .riwayat-card-total {
    font-size: 1rem;
  }
  .riwayat-card > div:last-child {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Make header and stats wrap properly */
  .admin-stats {
    grid-template-columns: 1fr;
  }
  .riwayat-filter-bar {
    flex-direction: column;
    gap: 1rem;
  }
  .riwayat-filter-group {
    width: 100%;
  }
  .filter-input {
    width: 100%;
  }
}
