/* --- Mobile Design Tokens --- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --navy: #1a237e;
  --text-dark: #0f172a;
  --text-gray: #64748b;
  --text-light: #94a3b8;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

/* --- Base Reset & Mobile Container (Dynamic Island & Full Screen Support) --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: 'Poppins', sans-serif;
  background-color: #1e40af; /* Exact match with top hero blue */
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow-x: hidden;
}

/* Mobile-first full screen container */
.app-container {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  margin: 0 auto;
}

/* On desktop simulation (> 768px), frame with clean smartphone canvas */
@media (min-width: 768px) {
  body {
    align-items: center;
    padding: 20px 0;
    background: #0f172a;
  }
  .app-container {
    max-width: 440px;
    height: 92vh;
    max-height: 900px;
    border-radius: 36px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
  }
  .bottom-nav {
    max-width: 440px;
    border-radius: 0 0 36px 36px;
  }
}

/* --- Utilities --- */
.flex-1 { flex: 1; }
.hidden { display: none !important; }

.status-banner {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.status-banner.online {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.status-banner.offline {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
  animation: pulse 2s infinite;
}

/* --- Floating Sync Queue Bar --- */
.sync-queue-bar {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.25);
  z-index: 998;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sync-btn-link {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.sync-btn-link:active {
  background-color: rgba(255, 255, 255, 0.35);
}
@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes pulse {
  0% { opacity: 0.9; }
  50% { opacity: 0.7; }
  100% { opacity: 0.9; }
}

/* --- Custom Alerts / Overlays --- */
.overlay-alert {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay-alert.show {
  opacity: 1;
  pointer-events: auto;
}
.alert-box {
  background: var(--bg-white);
  padding: 24px;
  border-radius: var(--radius-lg);
  width: 85%;
  max-width: 320px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.overlay-alert.show .alert-box {
  transform: scale(1);
}
.alert-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.alert-title {
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.alert-desc {
  font-size: 0.9rem;
  color: var(--text-gray);
  line-height: 1.4;
  margin-bottom: 16px;
}
.alert-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

/* --- UI: Login Page --- */
.login-screen {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 10% 20%, rgba(243, 244, 246, 0.6) 0%, rgba(224, 242, 254, 0.4) 90%);
}
.login-screen::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0) 70%);
  z-index: 1;
}
.login-screen::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0) 70%);
  z-index: 1;
}
.login-header {
  text-align: center;
  margin-top: 30px;
  z-index: 2;
}
.app-shield-logo {
  width: 84px;
  height: 84px;
  background: #ffffff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  padding: 8px;
  transition: transform 0.3s ease;
}
.app-shield-logo:hover {
  transform: scale(1.05);
}
.app-shield-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.app-shield-logo svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
}
.app-title {
  color: var(--navy);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--navy) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.app-subtitle {
  color: var(--text-gray);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.login-form-container {
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  padding: 28px 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
  z-index: 2;
}
.form-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  text-align: left;
}
.input-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-gray);
  margin-bottom: 6px;
  display: block;
  text-align: left;
}
.input-wrapper {
  position: relative;
  margin-bottom: 18px;
}
.input-icon-left {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.1rem;
  transition: color 0.2s ease;
}
.input-icon-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  background: none;
}
.input-wrapper .mobile-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background-color: var(--bg-light);
  outline: none;
}
.mobile-input:focus {
  border-color: var(--primary);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.input-wrapper:focus-within .input-icon-left {
  color: var(--primary);
}
.forgot-pass-link {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-top: -6px;
  margin-bottom: 22px;
}
.mobile-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  outline: none;
}
.mobile-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}
.mobile-btn:disabled {
  background: var(--text-light);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Footer style */
.login-footer {
  text-align: center;
  margin-top: auto;
}
.dinas-pupr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-light);
  border-radius: 20px;
  margin-bottom: 12px;
}
.flag-icon {
  width: 12px;
  height: 8px;
  background: linear-gradient(to bottom, #ef4444 50%, #ffffff 50%);
  border: 0.5px solid var(--text-light);
}
.badge-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
}
.footer-text {
  font-size: 0.65rem;
  color: var(--text-light);
  line-height: 1.4;
  padding: 0 20px;
}

/* --- UI: Dashboard Page --- */
.dashboard-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f8fafc;
}

/* --- Dashboard Header Badges --- */
.header-badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}
.header-badge.pupr {
  background-color: #eff6ff;
  color: var(--navy);
  border-color: #dbeafe;
}
.header-badge.gps {
  background-color: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.header-badge.gps::before {
  content: "";
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}
.header-badge.sync {
  background-color: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

/* --- Dashboard Hero Greeting & Header (UI/UX Pro Max) --- */
.dash-hero-header {
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-left: calc(18px + env(safe-area-inset-left, 0px));
  padding-right: calc(18px + env(safe-area-inset-right, 0px));
  padding-bottom: 20px;
  background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 40%, #2563eb 100%);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.2);
  color: #ffffff;
  position: relative;
  overflow: visible;
  z-index: 50;
}
.dash-hero-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.dash-status-pill {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dash-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}
.dash-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.dash-user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
  color: #1e40af;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}
.dash-user-info {
  flex: 1;
  min-width: 0;
}
.dash-greet-tag {
  font-size: 0.72rem;
  color: #bfdbfe;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dash-user-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 2px 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.dash-date-tag {
  font-size: 0.68rem;
  color: #93c5fd;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dash-skpd-box {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 10px 12px;
  position: relative;
  z-index: 100;
}
.dash-skpd-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Top 3 KPI Stats Grid --- */
.dash-kpi-container {
  margin-top: 14px;
  padding: 0 16px;
  position: relative;
  z-index: 10;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.dash-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 8px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}
.dash-kpi-card:active {
  transform: scale(0.96);
}
.dash-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 4px;
}
.dash-kpi-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.dash-kpi-icon-wrap.active { background: #eff6ff; color: #2563eb; }
.dash-kpi-icon-wrap.today { background: #fffbeb; color: #d97706; }
.dash-kpi-icon-wrap.done { background: #ecfdf5; color: #059669; }
.dash-kpi-badge {
  font-size: 0.52rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
}
.dash-kpi-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: #334155;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-kpi-desc {
  font-size: 0.52rem;
  color: #94a3b8;
  line-height: 1.15;
  margin-top: 1px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Quick Action Shortcuts Scroller --- */
.dash-quick-shortcuts {
  padding: 0 16px 14px 16px;
}
.dash-section-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.dash-section-subhead-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dash-section-subhead-desc {
  font-size: 0.65rem;
  color: #94a3b8;
}
.dash-shortcuts-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-shortcuts-scroller::-webkit-scrollbar {
  display: none;
}
.dash-shortcut-chip {
  flex: 1;
  min-width: 125px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.dash-shortcut-chip:active {
  transform: scale(0.96);
  background: #f8fafc;
}
.dash-chip-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.dash-chip-icon.blue { background: #eff6ff; color: #2563eb; }
.dash-chip-icon.green { background: #ecfdf5; color: #059669; }
.dash-chip-icon.amber { background: #fffbeb; color: #d97706; }
.dash-chip-text {
  display: flex;
  flex-direction: column;
}
.dash-chip-text strong {
  font-size: 0.68rem;
  color: #1e293b;
  line-height: 1.2;
  font-weight: 700;
}
.dash-chip-text span {
  font-size: 0.58rem;
  color: #94a3b8;
  line-height: 1.1;
}

/* --- Project Progress List --- */
.project-progress-section {
  padding: 10px 16px 100px 16px;
  flex: 1;
}
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}
.view-all-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.year-select-wrapper {
  position: relative;
}
.year-select-db {
  padding: 6px 28px 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-light);
  color: var(--text-dark);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.project-progress-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 14px;
  margin-bottom: 12px;
  background-color: var(--bg-white);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}
.interactive-project-card {
  cursor: pointer;
}
.interactive-project-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.interactive-project-card:active {
  transform: scale(0.98);
  background-color: #f8fafc;
}
.proj-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}
.proj-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  flex: 1;
}
.proj-pct {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}
.proj-pct.selesai {
  color: var(--success);
}
.progress-bar-bg {
  width: 100%;
  height: 7px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.progress-bar-fill.selesai {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.m-deviasi-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.m-deviasi-badge.dev-positive {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.m-deviasi-badge.dev-neutral {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.m-deviasi-badge.dev-negative {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}


/* --- Sliding Upload Panel --- */
.upload-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow: hidden;
}
.upload-panel-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.upload-sliding-panel {
  position: absolute;
  bottom: -100%;
  left: 0;
  right: 0;
  background-color: var(--bg-white);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
  z-index: 601;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  transition: bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.upload-panel-overlay.show .upload-sliding-panel {
  bottom: 0;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}
.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}
.panel-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-gray);
  cursor: pointer;
}

/* --- Bottom Navigation Tab Bar (Safe Area Adaptable) --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 100%;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)) 10px;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 500;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.05);
}
@media (min-width: 768px) {
  .bottom-nav {
    position: absolute;
    max-width: 440px;
    border-radius: 0 0 40px 40px;
  }
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: none;
  font-family: inherit;
  opacity: 0.55;
  position: relative;
  padding: 6px 0;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.bottom-nav-placeholder {
  display: none;
}

/* --- Assistive Touch Floating Camera Button --- */
.assistive-touch-btn {
  position: fixed;
  right: 20px;
  bottom: 100px;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  border: none;
  cursor: pointer;
  z-index: 9999;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  transition: box-shadow 0.3s ease, opacity 0.3s ease, transform 0.15s ease;
  opacity: 0.85;
}
.assistive-touch-btn:hover,
.assistive-touch-btn.dragging {
  opacity: 1;
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.55);
}
.assistive-touch-btn:active {
  transform: scale(0.9);
}
.assistive-touch-btn.idle {
  opacity: 0.45;
}
.assistive-touch-btn.snapping {
  transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              top 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease, opacity 0.3s ease;
}
/* Subtle pulse ring when idle */
.assistive-touch-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.25);
  animation: atPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}
.assistive-touch-btn.dragging::before,
.assistive-touch-btn.idle::before {
  animation: none;
  opacity: 0;
}
@keyframes atPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0; }
}
.bottom-nav-item.active {
  color: var(--primary);
  opacity: 1;
}
.bottom-nav-item i {
  font-size: 1.3rem;
  margin-bottom: 4px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bottom-nav-item.active i {
  transform: scale(1.15) translateY(-2px);
}
.bottom-nav-item:active i {
  transform: scale(0.85);
}
/* Active dot indicator under icon */
.bottom-nav-item::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bottom-nav-item.active::after {
  width: 20px;
}
/* Ripple on tap */
.bottom-nav-item .nav-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  transform: scale(0);
  animation: navRipple 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes navRipple {
  to { transform: scale(2.5); opacity: 0; }
}


/* --- Dynamic Screen Content with Slide Transitions --- */
.screen-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 68px;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s 0.35s;
  will-change: transform, opacity;
}
.screen-content.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s 0s;
  position: relative;
  bottom: auto;
}
.screen-content.slide-left {
  transform: translateX(-40px);
}
.screen-content.slide-right {
  transform: translateX(40px);
}
#kegiatanScreen.active {
  display: flex;
  height: calc(100dvh - 64px - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

/* Respect user's reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .screen-content {
    transition: none;
    transform: none;
  }
  .screen-content.active {
    transition: none;
  }
  .screen-content.slide-left,
  .screen-content.slide-right {
    transform: none;
  }
  .bottom-nav-item i {
    transition: none;
  }
  .bottom-nav-item::after {
    transition: none;
  }
  .assistive-touch-btn {
    transition: none;
  }
  .assistive-touch-btn::before {
    animation: none;
  }
  .bottom-nav-item .nav-ripple {
    animation: none;
  }
}
#kegiatanListTab::-webkit-scrollbar {
  width: 4px;
}
#kegiatanListTab::-webkit-scrollbar-track {
  background: transparent;
}
#kegiatanListTab::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 10px;
}
#projectProgressList {
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
#projectProgressList::-webkit-scrollbar {
  width: 4px;
}
#projectProgressList::-webkit-scrollbar-track {
  background: transparent;
}
#projectProgressList::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 10px;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Profil Screen Styles */
.profile-screen-body {
  padding: 32px 20px 100px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-avatar-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3.5px solid var(--primary);
  background-color: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
  margin: 10px auto 16px auto;
}
.profile-username {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.profile-role {
  font-size: 0.8rem;
  color: var(--text-gray);
  font-weight: 600;
  margin-bottom: 2px;
}
.profile-agency {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 24px;
}
/* --- Admin Monitoring Dashboard Bento Grid --- */
.admin-monitoring-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 16px 14px;
  margin: 16px 20px 0 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
.admin-monitoring-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(226, 232, 240, 0.8);
}
.admin-monitoring-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(29, 78, 216, 0.08) 100%);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.admin-monitoring-title-box {
  flex: 1;
}
.admin-monitoring-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.25;
}
.admin-monitoring-subtitle {
  font-size: 0.72rem;
  color: var(--text-gray);
  margin-top: 2px;
  font-weight: 500;
}
.admin-monitoring-badge {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Bento Grid 2x4 */
.monitoring-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.m-stat-card {
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.m-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.m-stat-card:active {
  transform: scale(0.96);
}

.m-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.m-stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.m-stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
}
.m-stat-label {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-gray);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stat card color variants */
.m-stat-card.bp { border-left: 3.5px solid #f59e0b; }
.m-stat-card.bp .m-stat-icon { background: #fef3c7; color: #d97706; }
.m-stat-card.bp .m-stat-num { color: #d97706; }

.m-stat-card.knt { border-left: 3.5px solid #2563eb; }
.m-stat-card.knt .m-stat-icon { background: #dbeafe; color: #2563eb; }
.m-stat-card.knt .m-stat-num { color: #2563eb; }

.m-stat-card.sel { border-left: 3.5px solid #10b981; }
.m-stat-card.sel .m-stat-icon { background: #d1fae5; color: #059669; }
.m-stat-card.sel .m-stat-num { color: #059669; }

.m-stat-card.bel { border-left: 3.5px solid #f43f5e; }
.m-stat-card.bel .m-stat-icon { background: #ffe4e6; color: #e11d48; }
.m-stat-card.bel .m-stat-num { color: #e11d48; }

.m-stat-card.trg { border-left: 3.5px solid #8b5cf6; }
.m-stat-card.trg .m-stat-icon { background: #ede9fe; color: #7c3aed; }
.m-stat-card.trg .m-stat-num { color: #7c3aed; }

.m-stat-card.real { border-left: 3.5px solid #06b6d4; }
.m-stat-card.real .m-stat-icon { background: #cffafe; color: #0891b2; }
.m-stat-card.real .m-stat-num { color: #0891b2; }

.m-stat-card.dev { border-left: 3.5px solid #ea580c; }
.m-stat-card.dev .m-stat-icon { background: #ffedd5; color: #c2410c; }
.m-stat-card.dev .m-stat-num { color: #c2410c; }

.m-stat-card.null { border-left: 3.5px solid #64748b; }
.m-stat-card.null .m-stat-icon { background: #f1f5f9; color: #475569; }
.m-stat-card.active-card-filter {
  box-shadow: 0 0 0 2.5px var(--primary), 0 8px 20px rgba(37, 99, 235, 0.18) !important;
  background: #ffffff !important;
  transform: translateY(-2px);
}

/* Deviasi Badge on Project Progress Cards */
.m-deviasi-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}
.m-deviasi-badge.dev-negative {
  background: #ffe4e6;
  color: #e11d48;
  border: 1px solid #fecdd3;
}
.m-deviasi-badge.dev-positive {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.m-deviasi-badge.dev-neutral {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* --- PWA Install Floating Banner & Modal --- */
.pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 16px;
  right: 16px;
  z-index: 10050;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: slideUpPwa 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpPwa {
  from { transform: translateY(120%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pwa-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eff6ff;
  padding: 6px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  flex-shrink: 0;
}
.pwa-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pwa-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pwa-banner-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.pwa-banner-desc {
  font-size: 0.68rem;
  color: var(--text-gray);
  line-height: 1.35;
}
.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pwa-btn-primary {
  flex: 1;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}
.pwa-btn-primary:active {
  transform: scale(0.96);
}
.pwa-btn-secondary {
  background: transparent;
  color: var(--text-gray);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* --- PWA Guidance Modal Backdrop & Card --- */
.pwa-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pwa-modal-overlay.show {
  display: flex !important;
}
.pwa-modal-card {
  background: #ffffff;
  border-radius: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
  animation: popUpPwa 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popUpPwa {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (min-width: 480px) {
  .pwa-install-banner {
    max-width: 420px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
}




/* ========================================================== */
/* UI/UX PRO MAX REDESIGN: PROFIL & DIGITAL E-KTP SCREEN      */
/* ========================================================== */

/* Hero Header Profile */
.profile-header-hero {
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-left: calc(18px + env(safe-area-inset-left, 0px));
  padding-right: calc(18px + env(safe-area-inset-right, 0px));
  padding-bottom: 20px;
  background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 40%, #2563eb 100%);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.2);
  color: #ffffff;
  position: relative;
  overflow: visible;
  z-index: 40;
}
.profile-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.profile-header-title-box {
  display: flex;
  flex-direction: column;
}
.profile-screen-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.profile-screen-subtitle {
  font-size: 0.65rem;
  color: #93c5fd;
  font-weight: 500;
  margin-top: 1px;
}
.profile-verified-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* User Card in Hero */
.profile-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 14px 16px;
}
.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}
.profile-avatar-glow {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #38bdf8);
  opacity: 0.6;
  filter: blur(4px);
}
.profile-avatar-circle-hero {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  color: #1e40af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.profile-avatar-check {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  border: 2px solid #ffffff;
  z-index: 3;
}
.profile-user-details {
  flex: 1;
  min-width: 0;
}
.profile-fullname {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  margin-top: 4px;
}
.profile-agency-text {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  color: #cbd5e1;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Content Body */
.profile-content-body {
  padding: 16px 16px calc(140px + env(safe-area-inset-bottom, 0px)) 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Profile KPI 3-Cards Grid */
.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.profile-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}
.profile-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.profile-kpi-icon.blue { background: #eff6ff; color: #2563eb; }
.profile-kpi-icon.green { background: #ecfdf5; color: #059669; }
.profile-kpi-icon.amber { background: #fffbeb; color: #d97706; }
.profile-kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}
.profile-kpi-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: #334155;
  margin-top: 3px;
}
.profile-kpi-desc {
  font-size: 0.52rem;
  color: #94a3b8;
  margin-top: 1px;
}

/* Section Wrapper */
.profile-section-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}
.profile-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-section-chip {
  font-size: 0.58rem;
  font-weight: 800;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #dbeafe;
}

/* Digital E-KTP Card */
.digital-ktp-card {
  background: linear-gradient(135deg, #0284c7 0%, #1e40af 60%, #1e3a8a 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 16px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.25);
}
.digital-ktp-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 8px;
}
.digital-ktp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.digital-ktp-gov {
  display: flex;
  flex-direction: column;
}
.gov-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}
.gov-sub {
  font-size: 0.55rem;
  font-weight: 600;
  color: #bae6fd;
  margin-top: 1px;
}
.digital-ktp-chip-icon {
  font-size: 1.6rem;
  color: #fbbf24;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.digital-ktp-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}
.digital-ktp-row {
  display: grid;
  grid-template-columns: 85px 1fr;
  align-items: baseline;
  gap: 8px;
}
.ktp-lbl {
  font-size: 0.62rem;
  font-weight: 600;
  color: #93c5fd;
}
.ktp-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  word-break: break-word;
}
.ktp-val.highlight {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fef08a;
}
.digital-ktp-footer {
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  padding-top: 10px;
}
.btn-view-ktp {
  width: 100%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-view-ktp:active {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(0.98);
}

/* Settings Group Card */
.settings-group-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
}
.settings-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.settings-tile:last-child {
  border-bottom: none;
}
.settings-tile:active {
  background-color: #f8fafc;
}
.settings-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.settings-tile-icon.blue { background: #eff6ff; color: #2563eb; }
.settings-tile-icon.emerald { background: #ecfdf5; color: #059669; }
.settings-tile-icon.purple { background: #faf5ff; color: #9333ea; }
.settings-tile-icon.amber { background: #fffbeb; color: #d97706; }
.settings-tile-icon.cyan { background: #ecfeff; color: #0891b2; }
.settings-tile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.settings-tile-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
}
.settings-tile-sub {
  font-size: 0.64rem;
  color: #94a3b8;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-tile-arrow {
  font-size: 0.75rem;
  color: #cbd5e1;
  flex-shrink: 0;
}

/* App Info Card */
.profile-app-info-card {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-info-logo img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
}
.app-info-meta {
  display: flex;
  flex-direction: column;
}
.app-info-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #334155;
}
.app-info-version {
  font-size: 0.6rem;
  color: #64748b;
  margin-top: 1px;
}
.app-info-copyright {
  font-size: 0.55rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Logout Button */
.profile-logout-wrap {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 20px;
}
.profile-logout-btn {
  width: 100%;
  background: #ffffff;
  color: #e11d48;
  border: 1.5px solid #fecdd3;
  border-radius: 16px;
  padding: 13px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.05);
  transition: all 0.2s ease;
}
.profile-logout-btn:active {
  background: #fff1f2;
  border-color: #fda4af;
  transform: scale(0.98);
}

/* KTP Lightbox / Modal Panel */
.ktp-modal-panel {
  max-height: 85vh;
  padding-bottom: 24px;
}
.ktp-modal-body {
  padding: 12px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ktp-preview-container {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.ktp-img-wrapper {
  position: relative;
  width: 100%;
  background: #0f172a;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ktp-full-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 12px;
}
.ktp-verified-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}
.ktp-empty-state {
  padding: 30px 16px;
  text-align: center;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
}
.ktp-empty-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fee2e2;
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.ktp-empty-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}
.ktp-empty-desc {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.4;
}
.ktp-meta-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ktp-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}
.ktp-meta-label {
  color: #64748b;
  font-weight: 600;
}
.ktp-meta-value {
  color: #0f172a;
  font-weight: 700;
}

/* --- Dynamic Form Groups (Dashboard Modal) --- */
.form-group-db {
  margin-bottom: 18px;
}
.mobile-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  background-color: var(--bg-light);
  color: var(--text-dark);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}
.mobile-select:disabled {
  opacity: 0.6;
  background-color: var(--border-color);
}
.mobile-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  background-color: var(--bg-light);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mobile-input:focus {
  border-color: var(--primary);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- Webcam Container --- */
.camera-container {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #000000;
  position: relative;
  margin-bottom: 12px;
  border: 1.5px solid var(--border-color);
}
.camera-element {
  width: 100% !important;
  height: 100% !important;
}
.camera-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

/* --- Location Stats Card --- */
.location-card {
  background-color: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
}
.location-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--text-dark);
}
.location-item:last-child {
  margin-bottom: 0;
}
.location-item i {
  color: var(--primary);
  font-size: 1rem;
  margin-top: 2px;
}
.location-label {
  font-weight: 600;
  color: var(--text-gray);
  margin-right: 4px;
}

/* --- Spinner Animation --- */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid #ffffff;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- UI/UX Pro Max Redesign for Kegiatan Screen --- */
.kegiatan-header-hero {
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-left: calc(18px + env(safe-area-inset-left, 0px));
  padding-right: calc(18px + env(safe-area-inset-right, 0px));
  padding-bottom: 16px;
  background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 40%, #2563eb 100%);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.18);
  color: #ffffff;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  z-index: 40;
}
.kegiatan-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kegiatan-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.3px;
}
.kegiatan-subtitle {
  font-size: 0.7rem;
  color: #bfdbfe;
  margin-top: 2px;
  font-weight: 500;
}
.kegiatan-total-badge {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Kegiatan Search Container */
.search-container-keg {
  position: relative;
  margin-bottom: 12px;
}
.search-icon-keg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.85rem;
}
.search-input-keg {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.82rem;
  background-color: #ffffff;
  color: #1e293b;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}
.search-input-keg:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Filter Pills Row */
.filter-pills-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-pills-row::-webkit-scrollbar {
  display: none;
}
.filter-pill {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  -webkit-tap-highlight-color: transparent;
}
.filter-pill:active {
  transform: scale(0.95);
}
.filter-pill.active {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.filter-pill .pill-count {
  background: rgba(0, 0, 0, 0.07);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.65rem;
}
.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Kegiatan Card Item */
.kegiatan-card-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.kegiatan-card-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.kegiatan-card-item:active {
  transform: scale(0.98);
  background-color: #f8fafc;
}

/* Status Chips */
.keg-status-chip {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.keg-status-chip.aktif {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.keg-status-chip.selesai {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.keg-status-chip.tertunda {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.keg-status-chip.belum_ada_target, .keg-status-chip.draft {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.keg-rup-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 2px 6px;
  border-radius: 5px;
}
.keg-year-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  padding: 2px 6px;
  border-radius: 5px;
}

.app-header .panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

/* --- Detail Kegiatan Styles --- */
.back-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.back-circle-btn:active {
  background-color: var(--border-color);
}
.det-timeline-container {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid #e2e8f0;
  margin-left: 10px;
  margin-top: 10px;
}
.det-timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.det-timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid #fff;
}
.det-timeline-item.no-realisasi::before {
  background-color: #cbd5e1;
}
.det-timeline-week {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-gray);
  text-transform: uppercase;
  text-align: left;
}
.det-timeline-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 2px 0 4px 0;
  text-align: left;
}
.det-timeline-meta {
  font-size: 0.7rem;
  color: var(--text-gray);
  text-align: left;
}
.btn-history-trigger {
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.btn-history-trigger:active {
  opacity: 0.7;
}

/* --- Landscape Mode Responsiveness for Mobile Devices --- */
@media (orientation: landscape) and (max-height: 600px) {
  body {
    align-items: flex-start;
    padding: 0;
  }

  .app-container {
    max-width: 100% !important;
    min-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .bottom-nav {
    max-width: 100% !important;
    height: 52px !important;
    border-radius: 0 !important;
    padding: 0 24px;
  }

  .bottom-nav-item {
    padding: 2px 0;
  }

  .bottom-nav-item i {
    font-size: 1rem;
    margin-bottom: 2px;
  }

  .screen-content {
    padding-bottom: 64px !important;
  }

  .upload-sliding-panel {
    max-height: 96vh !important;
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
  }

  .status-banner {
    width: auto;
    max-width: calc(100% - 40px);
    top: 8px;
    padding: 6px 14px;
    font-size: 0.7rem;
  }

  .sync-queue-bar {
    width: auto;
    max-width: calc(100% - 40px);
    top: 8px;
    padding: 6px 14px;
    font-size: 0.7rem;
  }
}

/* --- UI UX PRO MAX: Interactive Progress & Weekly Breakdown Styles --- */
.interactive-stat-card {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.interactive-stat-card:active {
  transform: scale(0.97);
}
.interactive-stat-card .click-chip {
  transition: all 0.2s ease;
}
.interactive-stat-card:hover .click-chip {
  transform: translateX(2px);
  background-color: var(--primary) !important;
  color: #fff !important;
}
.interactive-stat-card.target-card:hover .click-chip {
  background-color: #475569 !important;
  color: #fff !important;
}
.btn-open-weekly-breakdown:active {
  transform: scale(0.98);
  opacity: 0.9;
}
.weekly-detail-card {
  animation: weeklyCardFadeIn 0.25s ease-out;
}
@keyframes weeklyCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.filter-chip {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.filter-chip:active {
  transform: scale(0.95);
}
.tab-mode-btn {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tab-mode-btn:active {
  transform: scale(0.97);
}
.layman-guide-box {
  transition: all 0.2s ease;
}
#detDeviasiRow:active {
  transform: scale(0.98);
  opacity: 0.92;
}
.btn-input-realisasi-card:active {
  transform: scale(0.98);
  opacity: 0.9;
}
.quick-pct-btn {
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.quick-pct-btn:active {
  transform: scale(0.93);
}
#inpRealisasi:focus, #inpKeterangan:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}



