/* =========================================================
   ABSENSI WFH - FRONTEND TAHAP 1
   Struktur file sengaja dibuat stabil agar revisi berikutnya
   tidak perlu mengubah susunan folder.
   ========================================================= */

:root {
  --navy-950: #050b16;
  --navy-900: #0a1830;
  --navy-800: #12294d;
  --navy-700: #1d4c8a;

  --green-600: #0ea968;
  --green-500: #22c48a;
  --yellow-500: #f5b93d;
  --red-600: #ef4a5b;
  --blue-500: #3d8bf5;

  --text: #eef4fc;
  --muted: #9db0c8;

  --card: rgba(10, 24, 48, .70);
  --card-border: rgba(255,255,255,.12);
  --shadow: 0 26px 80px rgba(2, 8, 20, .48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #05090f;
  overflow-x: hidden;
}

::selection {
  background: rgba(34, 196, 138, .32);
  color: #fff;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); }

button,
input {
  font: inherit;
}

/* =========================
   BACKGROUND ANIMATION
   ========================= */

.animated-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 14%, rgba(61, 139, 245, .24), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(34, 196, 138, .18), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(124, 92, 245, .14), transparent 40%),
    linear-gradient(135deg, #04080f, #0a1830 48%, #061120);
}

.bg-grid {
  position: absolute;
  inset: -50%;
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(900px) rotateX(58deg) translateY(4%);
  animation: gridMove 22s linear infinite;
}

.orb {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(20px);
  opacity: .24;
  animation: floatOrb 14s ease-in-out infinite;
}

.orb-1 {
  left: -90px;
  top: 12%;
  background: #3d8bf5;
}

.orb-2 {
  right: -100px;
  top: 42%;
  background: #22c48a;
  animation-delay: -4s;
}

.orb-3 {
  left: 40%;
  bottom: -180px;
  background: #7c5cf5;
  animation-delay: -8s;
}

@keyframes gridMove {
  from {
    transform: perspective(900px) rotateX(58deg) translateY(4%) translateX(0);
  }
  to {
    transform: perspective(900px) rotateX(58deg) translateY(4%) translateX(48px);
  }
}

@keyframes floatOrb {
  0%, 100% {
    transform: translate3d(0,0,0) scale(1);
  }
  50% {
    transform: translate3d(34px,-28px,0) scale(1.08);
  }
}

/* =========================
   MAIN CARDS
   ========================= */

.page-shell {
  position: relative;
  min-height: 100vh;
}

.glass-card {
  background: linear-gradient(150deg, rgba(18, 41, 77, .72), rgba(7, 17, 33, .82));
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: 26px;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.hero-card {
  padding: 30px 22px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -110px;
  top: -110px;
  border-radius: 50%;
  background: rgba(20, 189, 89, .12);
}

.hero-logo-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 15px;
  border-radius: 25px;
  padding: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 0 34px rgba(255,255,255,.04);
}

.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eyebrow {
  letter-spacing: .14em;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 900;
  color: #b9d5f5;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.65rem);
  font-weight: 850;
  letter-spacing: -.03em;
}

.hero-subtitle {
  color: var(--muted);
}

.live-clock {
  width: fit-content;
  min-width: min(100%, 430px);
  max-width: 100%;
  padding: 14px 22px;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.09);
  color: #dceaff;
  font-weight: 800;
  text-align: center;
}

.live-date-row,
.live-time-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.live-date-row {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 850;
  line-height: 1.35;
}

.live-time-row {
  margin-top: 5px;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 900;
  letter-spacing: .04em;
  color: #ffffff;
}

.live-date-row i,
.live-time-row i {
  color: #7fc0ff;
}

.section-card {
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0 0 3px;
  font-size: 1.17rem;
  font-weight: 850;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.section-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #1a5f9f, #153d68);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 1.2rem;
}

/* =========================
   SEARCH / DATA PEGAWAI
   ========================= */

.form-label {
  color: #c9d7e8;
  font-size: .9rem;
  font-weight: 750;
}

.custom-input {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.075);
  color: #fff;
  box-shadow: none !important;
}

.custom-input::placeholder {
  color: #8898ab;
}

.custom-input:focus {
  color: #fff;
  background: rgba(255,255,255,.09);
  border-color: rgba(64, 154, 255, .78);
}

.search-btn {
  min-width: 145px;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  font-weight: 850;
  background: linear-gradient(135deg, #1e7fe8, #175aab);
  box-shadow: 0 12px 26px rgba(31, 122, 224, .20);
}

.employee-panel {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  animation: slideUpFade .45s ease both;
}

.employee-found-bar,
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.employee-found-bar {
  color: #7df0ac;
  font-size: .92rem;
  font-weight: 850;
}

.data-field {
  height: 100%;
  padding: 15px 16px;
  border-radius: 15px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
}

.data-label {
  display: block;
  margin-bottom: 5px;
  color: #92a5bc;
  font-size: .77rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 750;
}

.data-field strong {
  color: #f7fbff;
  font-size: .96rem;
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(243, 182, 29, .14);
  color: #ffd56b;
  border: 1px solid rgba(243,182,29,.20);
  font-size: .77rem;
  font-weight: 850;
}

.status-ready {
  color: #83f0af;
  background: rgba(13,156,73,.14);
  border-color: rgba(13,156,73,.25);
}

/* =========================
   UPLOAD / SUBMIT / PREVIEW
   ========================= */

.upload-choice {
  width: 100%;
  min-height: 88px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  color: #fff;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.upload-choice:hover {
  transform: translateY(-2px);
}

.upload-file-btn {
  background: linear-gradient(135deg, rgba(30,103,179,.25), rgba(14,45,78,.86));
}

.upload-file-btn:hover {
  border-color: rgba(60,144,229,.50);
  box-shadow: 0 12px 26px rgba(14,75,140,.18);
}

.selfie-btn {
  background: linear-gradient(135deg, rgba(13,153,74,.22), rgba(8,65,38,.74));
}

.selfie-btn:hover {
  border-color: rgba(38,204,106,.48);
  box-shadow: 0 12px 26px rgba(8,105,50,.18);
}

.choice-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(255,255,255,.10);
  font-size: 1.3rem;
}

.choice-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-text strong {
  font-size: .98rem;
  letter-spacing: .02em;
}

.choice-text small {
  color: #aabbd0;
  font-size: .79rem;
}

.send-area {
  padding: 24px 0 6px;
  margin-top: 4px;
  text-align: center;
}

.send-area-bottom {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.send-btn {
  min-width: min(100%, 320px);
  min-height: 55px;
  color: #fff;
  border: 0;
  border-radius: 15px;
  font-weight: 900;
  letter-spacing: .025em;
  background: linear-gradient(135deg, #13ad52, #087a37);
  box-shadow: 0 16px 34px rgba(10, 150, 69, .22);
  transition: transform .2s ease, filter .2s ease;
}

.send-btn:hover {
  color: #fff;
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.send-btn.update-mode {
  background: linear-gradient(135deg, #e7a817, #b67808);
  color: #111;
}

.send-btn:disabled {
  opacity: .48;
  box-shadow: none;
  transform: none;
}

.send-area small {
  display: block;
  margin-top: 9px;
  color: #91a2b6;
}

.preview-section {
  padding-top: 20px;
  animation: slideUpFade .5s ease both;
}

.preview-header {
  margin-bottom: 14px;
}

.preview-header h3 {
  margin: 0 0 3px;
  font-size: 1.05rem;
  font-weight: 850;
}

.preview-header p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 14px;
}

.photo-preview-box,
.geo-preview-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: #03070c;
}

.photo-preview-box {
  min-height: 290px;
  display: grid;
  place-items: center;
}

.photo-preview-box img {
  width: 100%;
  max-height: 520px;
  display: block;
  object-fit: contain;
}

.preview-fallback {
  width: 100%;
  min-height: 290px;
  padding: 40px 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #dce8f8;
}

.preview-fallback:not(.d-none) {
  display: flex;
}

.preview-fallback i {
  color: #75aee8;
  font-size: 3rem;
}

.preview-fallback small {
  max-width: 360px;
  text-align: center;
  color: #9eb0c6;
}

.geo-preview-card {
  padding: 16px;
  background: linear-gradient(155deg, rgba(2,8,13,.96), rgba(7,25,17,.95));
}

.geo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #75f3a8;
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.geo-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.geo-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .78rem;
}

.geo-lines span {
  color: #9aabba;
}

.geo-lines strong {
  color: #eef9f3;
  text-align: right;
  font-weight: 750;
}

.map-frame,
.map-placeholder {
  width: 100%;
  min-height: 195px;
  border-radius: 14px;
  border: 0;
  overflow: hidden;
}

.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: #9aabba;
  background: rgba(255,255,255,.04);
  border: 1px dashed rgba(255,255,255,.10);
}

.map-placeholder i {
  font-size: 2rem;
}

/* =========================
   MODAL / ANIMATED NOTICE
   ========================= */

.app-modal .modal-dialog {
  max-width: 480px;
}

.custom-modal-content {
  overflow: hidden;
  color: #edf4ff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: linear-gradient(145deg, #102943, #081727);
  box-shadow: 0 28px 80px rgba(0,0,0,.55);
}

.app-modal.show .modal-dialog {
  animation: modalPop .32s cubic-bezier(.2,.8,.2,1) both;
}

.modal-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  animation: iconPulse 1.7s ease-in-out infinite;
}

.modal-icon.success {
  color: #7df0ac;
  background: rgba(12,157,73,.14);
  border: 1px solid rgba(53,220,119,.25);
}

.modal-icon.warning {
  color: #ffd25b;
  background: rgba(243,182,29,.14);
  border: 1px solid rgba(243,182,29,.25);
}

.modal-icon.error {
  color: #ff8d94;
  background: rgba(200,35,44,.14);
  border: 1px solid rgba(240,71,80,.25);
}

.modal-icon.info {
  color: #78baff;
  background: rgba(31,123,220,.14);
  border: 1px solid rgba(84,155,233,.25);
}

.modal-title-custom {
  font-weight: 900;
}

.modal-message {
  margin: 8px auto 20px;
  color: #afbed0;
  line-height: 1.55;
}

.action-btn {
  min-width: 130px;
  border-radius: 13px;
  font-weight: 850;
  padding: 10px 16px;
}

.progress-wrap {
  margin: 18px 0 8px;
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, #0da14b, #29d471);
}

.progress-wrap small {
  display: block;
  margin-top: 8px;
  color: #9eb0c5;
  font-weight: 750;
}

/* =========================
   CAMERA MODAL
   ========================= */

.camera-modal .modal-content {
  border: 0;
}

.camera-modal-content {
  min-height: 100vh;
  color: #fff;
  background: #030508;
}

.camera-topbar {
  min-height: 112px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  background: linear-gradient(180deg, #0d1c31, #0b1728);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.camera-topbar h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
}

.camera-topbar p {
  margin: 4px 0 0;
  color: #d0d9e5;
  font-size: .93rem;
}

.camera-close-x {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.08);
}

.camera-stage {
  flex: 1;
  min-height: 0;
  background: #000;
}

.camera-visual-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 212px);
  min-height: 470px;
  overflow: hidden;
  background: #000;
}

#cameraVideo,
#capturedImage {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

#cameraVideo {
  transform: scaleX(-1);
}

.camera-guide .corner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-color: rgba(255,255,255,.75);
  pointer-events: none;
}

.corner.tl {
  left: 22px;
  top: 22px;
  border-left: 3px solid;
  border-top: 3px solid;
  border-radius: 10px 0 0 0;
}

.corner.tr {
  right: 22px;
  top: 22px;
  border-right: 3px solid;
  border-top: 3px solid;
  border-radius: 0 10px 0 0;
}

.corner.bl {
  left: 22px;
  bottom: 168px;
  border-left: 3px solid;
  border-bottom: 3px solid;
  border-radius: 0 0 0 10px;
}

.corner.br {
  right: 22px;
  bottom: 168px;
  border-right: 3px solid;
  border-bottom: 3px solid;
  border-radius: 0 0 10px 0;
}

.camera-geo-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  min-height: 140px;
  display: grid;
  grid-template-columns: minmax(240px, 35%) 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(36, 209, 101, .75);
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(3,7,10,.91), rgba(9,10,10,.90));
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.camera-map-col {
  min-height: 116px;
}

.camera-map-frame,
.camera-map-placeholder {
  width: 100%;
  height: 116px;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
}

.camera-map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c8d7e5;
  background: rgba(255,255,255,.07);
}

.camera-geo-info {
  padding: 4px 4px;
}

.camera-geo-info h3 {
  margin: 0 0 5px;
  color: #72eea4;
  font-size: .98rem;
  font-weight: 900;
}

.camera-geo-info p {
  margin: 5px 0;
  color: #f2f5f8;
  font-size: .82rem;
}

.gps-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: #7df0ac;
  font-size: .84rem;
  font-weight: 850;
}

.gps-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22d267;
  box-shadow: 0 0 0 0 rgba(34,210,103,.6);
  animation: gpsPulse 1.4s infinite;
}

.camera-actionbar {
  min-height: 100px;
  padding: 16px;
  display: grid;
  place-items: center;
  background: #0d1b2d;
  border-top: 1px solid rgba(255,255,255,.06);
}

.camera-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.camera-action-btn {
  min-width: 170px;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
}

.btn-warning.camera-action-btn {
  color: #111;
}

/* =========================
   ANIMATIONS
   ========================= */

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gpsPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34,210,103,.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34,210,103,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34,210,103,0);
  }
}

/* =========================
   FOOTER / RESPONSIVE
   ========================= */

.page-footer {
  padding: 4px 0 12px;
  color: #7890a8;
  font-size: .79rem;
}

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

  .camera-visual-wrap {
    height: calc(100vh - 230px);
    min-height: 500px;
  }

  .camera-geo-card {
    grid-template-columns: 1fr;
  }

  .camera-map-col {
    min-height: 100px;
  }

  .camera-map-frame,
  .camera-map-placeholder {
    height: 100px;
  }
}

@media (max-width: 575.98px) {
  .section-card {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-card {
    padding: 24px 16px;
    border-radius: 20px;
  }

  .live-clock {
    border-radius: 15px;
    padding: 13px 14px;
  }

  .live-date-row {
    font-size: 1rem;
  }

  .live-time-row {
    font-size: 1.28rem;
  }

  .camera-topbar {
    min-height: 116px;
    padding: 16px 56px 14px 14px;
    justify-content: flex-start;
    text-align: left;
  }

  .camera-topbar p {
    font-size: .8rem;
  }

  .camera-visual-wrap {
    height: calc(100vh - 244px);
    min-height: 520px;
  }

  .camera-geo-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-height: 238px;
    overflow: auto;
  }

  .corner.bl,
  .corner.br {
    bottom: 255px;
  }

  .camera-actions {
    width: 100%;
  }

  .camera-action-btn {
    flex: 1 1 145px;
    min-width: 0;
  }

  .search-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}


/* =========================
   REVISI GEOTAG + ALAMAT
   ========================= */

.geo-address-row {
  align-items: flex-start !important;
}

.geo-address-row strong {
  max-width: 70%;
  line-height: 1.45;
}

.camera-address-line {
  margin-top: 7px !important;
  line-height: 1.4;
}

.camera-address-line span {
  color: #d8e4ee;
}


/* =========================
   REVISI KAMERA NON-FULLSCREEN
   ========================= */

.camera-modal {
  --bs-modal-margin: 1.5rem;
}

.camera-modal .camera-dialog {
  width: min(94vw, 1240px);
  max-width: 1240px;
  margin: 1.5rem auto;
}

.camera-modal-content {
  min-height: 0 !important;
  height: min(88vh, 860px);
  max-height: 88vh;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 24px !important;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.62);
  background: #030508;
}

.camera-topbar {
  min-height: 96px;
  flex: 0 0 auto;
}

.camera-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.camera-visual-wrap {
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
}

.camera-actionbar {
  min-height: 88px;
  flex: 0 0 auto;
}

@media (max-width: 991.98px) {
  .camera-modal .camera-dialog {
    width: 96vw;
    max-width: 96vw;
    margin: 1rem auto;
  }

  .camera-modal-content {
    height: 92vh;
    max-height: 92vh;
  }

  .camera-topbar {
    min-height: 92px;
  }

  .camera-actionbar {
    min-height: 84px;
  }
}

@media (max-width: 575.98px) {
  .camera-modal {
    --bs-modal-margin: .5rem;
  }

  .camera-modal .camera-dialog {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    margin: 6px auto;
  }

  .camera-modal-content {
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 18px !important;
  }

  .camera-topbar {
    min-height: 104px;
  }

  .camera-actionbar {
    min-height: 86px;
  }
}


/* =========================
   REVISI GEOTAG LIVE KOMPAK
   - Kotak geotag kamera dibuat kecil.
   - Tetap 2 kolom pada desktop dan mobile.
   - Sesudah foto diambil kotak ini disembunyikan lewat JS,
     karena geotag + map sudah tertanam pada hasil foto.
   ========================= */

.camera-geo-card {
  left: 14px !important;
  right: auto !important;
  bottom: 14px !important;
  width: min(690px, calc(100% - 28px)) !important;
  min-height: 0 !important;
  max-height: 142px !important;
  grid-template-columns: minmax(180px, 34%) minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 9px !important;
  border-radius: 15px !important;
  overflow: hidden !important;
}

.camera-map-col {
  min-height: 0 !important;
  height: 122px !important;
}

.camera-map-frame,
.camera-map-placeholder {
  height: 122px !important;
  min-height: 122px !important;
  border-radius: 10px !important;
}

.camera-map-placeholder {
  padding: 10px !important;
  font-size: .76rem !important;
}

.camera-geo-info {
  min-width: 0;
  padding: 1px 2px !important;
  overflow: hidden;
}

.camera-geo-info h3 {
  margin: 0 0 3px !important;
  font-size: .80rem !important;
  line-height: 1.15 !important;
}

.gps-status {
  gap: 5px !important;
  margin-bottom: 3px !important;
  font-size: .72rem !important;
  line-height: 1.15 !important;
}

.gps-dot {
  width: 7px !important;
  height: 7px !important;
}

.camera-geo-info p {
  margin: 2px 0 !important;
  font-size: .68rem !important;
  line-height: 1.22 !important;
}

.camera-address-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px !important;
}

@media (max-width: 991.98px) {
  .camera-geo-card {
    width: min(620px, calc(100% - 24px)) !important;
    left: 12px !important;
    bottom: 12px !important;
    grid-template-columns: minmax(160px, 36%) minmax(0, 1fr) !important;
    max-height: 132px !important;
  }

  .camera-map-col,
  .camera-map-frame,
  .camera-map-placeholder {
    height: 112px !important;
    min-height: 112px !important;
  }
}

@media (max-width: 575.98px) {
  .camera-geo-card {
    left: 7px !important;
    bottom: 7px !important;
    width: calc(100% - 14px) !important;
    max-height: 116px !important;
    grid-template-columns: 132px minmax(0, 1fr) !important;
    gap: 7px !important;
    padding: 7px !important;
    border-radius: 13px !important;
  }

  .camera-map-col,
  .camera-map-frame,
  .camera-map-placeholder {
    height: 100px !important;
    min-height: 100px !important;
  }

  .camera-geo-info h3 {
    font-size: .70rem !important;
  }

  .gps-status {
    font-size: .64rem !important;
  }

  .camera-geo-info p {
    font-size: .59rem !important;
    line-height: 1.18 !important;
  }

  .camera-address-line {
    -webkit-line-clamp: 2;
  }

  /* Sudut framing jangan tertutup kotak geotag yang sekarang lebih kecil */
  .corner.bl,
  .corner.br {
    bottom: 128px !important;
  }
}

@media (max-width: 390px) {
  .camera-geo-card {
    grid-template-columns: 112px minmax(0, 1fr) !important;
    max-height: 106px !important;
  }

  .camera-map-col,
  .camera-map-frame,
  .camera-map-placeholder {
    height: 90px !important;
    min-height: 90px !important;
  }

  .camera-geo-info p {
    font-size: .55rem !important;
  }

  .camera-geo-info h3 {
    font-size: .66rem !important;
  }

  .corner.bl,
  .corner.br {
    bottom: 116px !important;
  }
}

/* ===== LIGHT/DARK MODE + BANNER + MAINTENANCE ===== */
.frontend-theme-toggle{position:fixed;top:18px;right:18px;z-index:1050;width:44px;height:44px;border-radius:50%;border:1px solid rgba(255,255,255,.25);background:rgba(10,27,52,.72);color:#fff;backdrop-filter:blur(12px);box-shadow:0 8px 25px rgba(0,0,0,.2)}
body.front-light{background:linear-gradient(135deg,#eaf4ff,#f8fbff 45%,#dfeeff)!important;color:#17263b}body.front-light .glass-card{background:rgba(255,255,255,.78)!important;border-color:rgba(40,110,180,.16)!important;color:#17263b!important}body.front-light .glass-card p,body.front-light .glass-card small,body.front-light .eyebrow{color:#52657d!important}body.front-light .form-control{background:#fff!important;color:#17263b!important;border-color:#cbd8e7!important}body.front-light .frontend-theme-toggle{background:#fff;color:#0d6efd;border-color:#d8e3ef}.maintenance-screen{position:fixed;inset:0;z-index:99999;background:linear-gradient(135deg,#07182e,#0e315a);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:28px}.maintenance-screen.d-none{display:none!important}.maintenance-screen>img{width:74px;margin:20px 0 10px}.maintenance-screen h1{font-size:clamp(2rem,5vw,3.6rem);margin:0 0 12px}.maintenance-screen p{max-width:720px;color:#d5e8ff}.maintenance-worker{width:260px;height:180px;position:relative}.worker-head{position:absolute;width:58px;height:58px;border-radius:50%;background:#f1bd8c;left:92px;top:8px}.worker-head:before{content:'';position:absolute;width:68px;height:25px;border-radius:40px 40px 8px 8px;background:#f6c344;left:-5px;top:-8px}.worker-body{position:absolute;width:100px;height:105px;border-radius:45px 45px 15px 15px;background:#1682e8;left:72px;top:58px}.worker-arm{position:absolute;width:78px;height:20px;background:#f1bd8c;border-radius:20px;left:130px;top:98px;transform-origin:left;animation:workerArm 1.1s ease-in-out infinite alternate}.worker-laptop{position:absolute;width:105px;height:65px;background:#dce8f4;border:5px solid #8fa6bd;border-radius:7px;right:0;bottom:4px;color:#0d6efd;display:grid;place-items:center;font-size:1.8rem}.gear{position:absolute;font-size:30px;animation:spinGear 2.2s linear infinite}.g1{right:5px;top:8px}.g2{left:8px;bottom:5px;animation-direction:reverse}@keyframes workerArm{to{transform:rotate(15deg)}}@keyframes spinGear{to{transform:rotate(360deg)}}.maintenance-dots{display:flex;gap:8px}.maintenance-dots i{width:10px;height:10px;border-radius:50%;background:#65b7ff;animation:dotPulse 1s infinite alternate}.maintenance-dots i:nth-child(2){animation-delay:.25s}.maintenance-dots i:nth-child(3){animation-delay:.5s}@keyframes dotPulse{to{opacity:.25;transform:translateY(-6px)}}


/* =========================================================
   FRONTEND LIGHT / DARK MODE
   Dark Mode mempertahankan tampilan asli.
   ========================================================= */
.frontend-theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 1085;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid rgba(125, 211, 252, .32);
  border-radius: 14px;
  background: rgba(8, 27, 49, .82);
  color: #f8fbff;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: transform .2s ease, background .25s ease, color .25s ease,
              border-color .25s ease, box-shadow .25s ease;
}
.frontend-theme-toggle:hover { transform: translateY(-2px); }
.frontend-theme-toggle .theme-icon-dark { display: none; }

html[data-frontend-theme="light"] .frontend-theme-toggle {
  background: rgba(255,255,255,.92);
  color: #15304f;
  border-color: rgba(37,99,235,.22);
  box-shadow: 0 10px 28px rgba(30,64,175,.13);
}
html[data-frontend-theme="light"] .frontend-theme-toggle .theme-icon-light { display: none; }
html[data-frontend-theme="light"] .frontend-theme-toggle .theme-icon-dark { display: inline-block; }

/* Light mode: halaman */
html[data-frontend-theme="light"] body {
  color: #14243a;
  background:
    radial-gradient(circle at 88% 14%, rgba(14,165,233,.16), transparent 28%),
    radial-gradient(circle at 8% 80%, rgba(37,99,235,.12), transparent 30%),
    linear-gradient(135deg, #eef7ff 0%, #f8fbff 50%, #e9f7f4 100%) !important;
}

/* Lapisan background animasi tetap hidup tetapi lebih lembut */
html[data-frontend-theme="light"] body::before,
html[data-frontend-theme="light"] body::after {
  opacity: .35;
}

/* Card utama dan section */
html[data-frontend-theme="light"] .glass-card,
html[data-frontend-theme="light"] .section-card,
html[data-frontend-theme="light"] .hero-card,
html[data-frontend-theme="light"] .employee-card,
html[data-frontend-theme="light"] .photo-card {
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(37,99,235,.17) !important;
  box-shadow: 0 18px 55px rgba(31,78,121,.11) !important;
  color: #14243a !important;
}

/* Teks */
html[data-frontend-theme="light"] h1,
html[data-frontend-theme="light"] h2,
html[data-frontend-theme="light"] h3,
html[data-frontend-theme="light"] h4,
html[data-frontend-theme="light"] h5,
html[data-frontend-theme="light"] .section-title,
html[data-frontend-theme="light"] .eyebrow,
html[data-frontend-theme="light"] label {
  color: #102a49 !important;
}
html[data-frontend-theme="light"] p,
html[data-frontend-theme="light"] small,
html[data-frontend-theme="light"] .text-muted,
html[data-frontend-theme="light"] .section-subtitle {
  color: #5c6f86 !important;
}

/* Tanggal / waktu */
html[data-frontend-theme="light"] .datetime-box,
html[data-frontend-theme="light"] .date-time-box,
html[data-frontend-theme="light"] .live-clock-card {
  background: rgba(230,240,252,.92) !important;
  border-color: rgba(37,99,235,.16) !important;
  color: #173557 !important;
}

/* Input */
html[data-frontend-theme="light"] .form-control,
html[data-frontend-theme="light"] .form-select {
  background: rgba(244,248,253,.96) !important;
  border-color: #b9cbe0 !important;
  color: #172c45 !important;
}
html[data-frontend-theme="light"] .form-control::placeholder {
  color: #8295aa !important;
}

/* Data pegawai / preview / geotag */
html[data-frontend-theme="light"] .employee-panel,
html[data-frontend-theme="light"] .preview-card,
html[data-frontend-theme="light"] .geo-card,
html[data-frontend-theme="light"] .upload-choice,
html[data-frontend-theme="light"] .photo-option {
  background: rgba(239,246,253,.86) !important;
  border-color: rgba(37,99,235,.15) !important;
  color: #172c45 !important;
}

/* Modal Bootstrap */
html[data-frontend-theme="light"] .modal-content:not(.camera-modal-content) {
  background: #ffffff !important;
  color: #172c45 !important;
  border-color: rgba(37,99,235,.15) !important;
}
html[data-frontend-theme="light"] .modal-content:not(.camera-modal-content) .modal-header,
html[data-frontend-theme="light"] .modal-content:not(.camera-modal-content) .modal-footer {
  border-color: #e1eaf3 !important;
}

/* Kamera tetap gelap agar preview kamera nyaman dilihat */
html[data-frontend-theme="light"] .camera-modal-content {
  background: #071422 !important;
  color: #fff !important;
}

/* Loading/progress */
html[data-frontend-theme="light"] .progress {
  background: #dce8f4 !important;
}

/* Footer */
html[data-frontend-theme="light"] footer,
html[data-frontend-theme="light"] .footer-note {
  color: #71839a !important;
}

@media (max-width: 767.98px) {
  .frontend-theme-toggle {
    top: 10px;
    right: 10px;
    min-height: 40px;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: .76rem;
  }
}
@media (max-width: 420px) {
  .frontend-theme-toggle span { display: none; }
  .frontend-theme-toggle {
    width: 42px;
    justify-content: center;
    padding: 8px;
  }
}

.editable-maintenance{position:fixed;inset:0;z-index:99999;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;background:radial-gradient(circle at 15% 15%,#123f69 0,transparent 30%),radial-gradient(circle at 88% 85%,#075f50 0,transparent 32%),#071727;color:#fff}
.editable-maintenance h1{font-size:clamp(2rem,5vw,3.5rem);margin:12px 0}.editable-maintenance>p{max-width:720px;color:#bed0e4;font-size:1.08rem;line-height:1.7}.maint-worker{display:flex;align-items:center;gap:20px;font-size:60px}.maint-person{animation:maintBob 1.8s ease-in-out infinite}.maint-gear{font-size:35px;animation:maintSpin 3s linear infinite}.maint-gear.g2{animation-direction:reverse}.maint-caption{margin-top:25px;color:#7ec8ff;font-size:.8rem;font-weight:800;text-transform:uppercase;letter-spacing:.15em}.maint-countdown{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:12px}.maint-countdown>div{min-width:95px;padding:14px;border:1px solid rgba(126,200,255,.25);border-radius:15px;background:rgba(255,255,255,.07)}.maint-countdown b{display:block;font-size:2rem}.maint-countdown span{font-size:.72rem;color:#a9bfd4;text-transform:uppercase}.maint-dots{margin-top:25px}.maint-dots i{display:inline-block;width:9px;height:9px;border-radius:50%;background:#61b9ff;margin:5px;animation:maintPulse 1.2s infinite}.maint-dots i:nth-child(2){animation-delay:.2s}.maint-dots i:nth-child(3){animation-delay:.4s}@keyframes maintSpin{to{transform:rotate(360deg)}}@keyframes maintBob{50%{transform:translateY(-7px)}}@keyframes maintPulse{50%{opacity:.25;transform:scale(.75)}}@media(max-width:500px){.maint-countdown>div{min-width:70px}.maint-countdown b{font-size:1.5rem}}


/* ===== MAINTENANCE MULTI WORKER ANIMATION ===== */
.maint-worksite{
  position:relative;
  width:min(760px,94vw);
  min-height:190px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:18px;
  margin:0 auto 12px;
  padding:28px 55px 18px;
}
.maint-worker-card{
  position:relative;
  width:140px;
  min-height:132px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:15px 10px 12px;
  border:1px solid rgba(126,200,255,.20);
  border-radius:22px;
  background:rgba(255,255,255,.055);
  box-shadow:0 15px 35px rgba(0,0,0,.16);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.maint-worker-card .worker-emoji{
  display:block;
  font-size:62px;
  line-height:1;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.22));
}
.maint-worker-card small{
  color:#b9d3ea;
  font-size:.72rem;
  font-weight:700;
  white-space:nowrap;
}
.worker-1{animation:workerFloatA 2.3s ease-in-out infinite}
.worker-2{animation:workerFloatB 2.6s ease-in-out infinite .25s}
.worker-3{animation:workerFloatA 2.4s ease-in-out infinite .5s}
.worker-4{animation:workerFloatB 2.7s ease-in-out infinite .75s}
.maint-worksite .maint-gear{
  position:absolute;
  color:#69c5ff;
  filter:drop-shadow(0 0 9px rgba(97,185,255,.35));
  animation:maintSpin 4s linear infinite;
}
.maint-worksite .gear-1{font-size:31px;left:17px;top:28px}
.maint-worksite .gear-2{font-size:23px;right:22px;top:43px;animation-direction:reverse}
.maint-worksite .gear-3{font-size:19px;right:7px;top:17px;animation-duration:2.8s}
@keyframes workerFloatA{
  0%,100%{transform:translateY(0) rotate(0)}
  50%{transform:translateY(-10px) rotate(-1deg)}
}
@keyframes workerFloatB{
  0%,100%{transform:translateY(-3px) rotate(0)}
  50%{transform:translateY(7px) rotate(1deg)}
}
@media(max-width:700px){
  .maint-worksite{
    width:min(430px,96vw);
    min-height:270px;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    padding:24px 38px 12px;
  }
  .maint-worker-card{
    width:100%;
    min-height:112px;
    border-radius:17px;
    padding:10px 6px;
  }
  .maint-worker-card .worker-emoji{font-size:49px}
  .maint-worker-card small{font-size:.62rem}
}
@media(max-width:390px){
  .maint-worksite{padding-left:25px;padding-right:25px}
  .maint-worker-card .worker-emoji{font-size:43px}
  .maint-worker-card small{font-size:.56rem}
}


/* ===== FRONTEND DESKTOP WIDTH REFINEMENT =====
   Membuat card utama lebih proporsional pada layar desktop lebar.
   Tidak mengubah layout mobile.
   ========================================================== */
@media (min-width: 1200px) {
  .app-shell,
  .app-container,
  main.container,
  main.container-fluid,
  body > .container,
  body > .container-fluid {
    max-width: 1320px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Struktur aktual frontend memakai container Bootstrap yang terlalu lebar
     pada resolusi 1680px ke atas. */
  .container {
    max-width: 1320px !important;
  }
}

@media (min-width: 1500px) {
  .app-shell,
  .app-container,
  main.container,
  main.container-fluid,
  body > .container,
  body > .container-fluid,
  .container {
    max-width: 1280px !important;
  }
}

/* Beri ruang samping yang konsisten pada desktop. */
@media (min-width: 992px) {
  body {
    padding-left: 28px;
    padding-right: 28px;
  }
}

/* Jangan menambah padding body pada HP/tablet kecil. */
@media (max-width: 991.98px) {
  body {
    padding-left: 0;
    padding-right: 0;
  }
}


/* ===== FRONTEND HEADING REFINEMENT ===== */
.eyebrow {
  font-size: clamp(1.35rem, 2vw, 1.85rem) !important;
  font-weight: 800 !important;
  letter-spacing: .15em !important;
  line-height: 1.25 !important;
}

@media (max-width: 767.98px) {
  .eyebrow {
    font-size: clamp(1rem, 4.4vw, 1.3rem) !important;
    letter-spacing: .09em !important;
  }
}


/* ===== SELFIE MODAL COMPACT REFINEMENT =====
   Memperkecil card Selfie Langsung pada desktop tanpa mengganggu mobile.
   ========================================================== */
@media (min-width: 992px) {
  .camera-dialog {
    width: min(88vw, 1040px) !important;
    max-width: 1040px !important;
    height: min(82vh, 760px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .camera-modal-content {
    max-height: 82vh !important;
    border-radius: 22px !important;
    overflow: hidden !important;
  }

  .camera-modal-content .modal-header {
    padding: 16px 22px !important;
  }

  .camera-modal-content .modal-header h2,
  .camera-modal-content .modal-title {
    font-size: clamp(1.55rem, 2.2vw, 2rem) !important;
  }

  .camera-stage {
    min-height: 420px !important;
    height: min(57vh, 520px) !important;
  }

  .camera-modal-content .modal-footer,
  .camera-actionbar {
    padding: 14px 20px !important;
    min-height: 78px !important;
  }

  .camera-actionbar .btn {
    min-width: 150px !important;
    padding: 11px 20px !important;
  }

  .camera-geo-card {
    width: min(610px, calc(100% - 28px)) !important;
    max-height: 126px !important;
    grid-template-columns: minmax(160px, 32%) minmax(0, 1fr) !important;
  }

  .camera-map-col,
  .camera-map-frame,
  .camera-map-placeholder {
    height: 106px !important;
    min-height: 106px !important;
  }
}

/* Desktop sangat lebar: tetap kompak, tidak ikut membesar. */
@media (min-width: 1500px) {
  .camera-dialog {
    width: 980px !important;
    max-width: 980px !important;
  }
  .camera-stage {
    height: 490px !important;
  }
}


/* ===== SELFIE MODAL PORTRAIT ORIENTATION =====
   Modal selfie desktop dibuat vertikal/portrait.
   ========================================================== */
@media (min-width: 768px) {
  .camera-dialog {
    width: min(92vw, 620px) !important;
    max-width: 620px !important;
    height: min(92vh, 860px) !important;
    margin: 1.75rem auto !important;
  }

  .camera-modal-content {
    width: 100% !important;
    max-height: 92vh !important;
    border-radius: 24px !important;
    overflow: hidden !important;
  }

  .camera-modal-content .modal-header {
    padding: 15px 20px !important;
  }

  .camera-modal-content .modal-header h2,
  .camera-modal-content .modal-title {
    font-size: 1.55rem !important;
  }

  .camera-modal-content .modal-header p {
    font-size: .82rem !important;
    margin-bottom: 0 !important;
  }

  .camera-stage {
    position: relative !important;
    width: 100% !important;
    height: min(65vh, 610px) !important;
    min-height: 500px !important;
    background: #000 !important;
  }

  #cameraVideo,
  #capturedImage {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Geotag ditempatkan di bawah area portrait, tetap sebagai overlay ringkas. */
  .camera-geo-card {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    max-height: 122px !important;
    grid-template-columns: 155px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }

  .camera-map-col,
  .camera-map-frame,
  .camera-map-placeholder {
    height: 104px !important;
    min-height: 104px !important;
  }

  .camera-geo-info h3 {
    font-size: .72rem !important;
  }

  .camera-geo-info p,
  .gps-status {
    font-size: .60rem !important;
  }

  .camera-actionbar,
  .camera-modal-content .modal-footer {
    min-height: 72px !important;
    padding: 11px 14px !important;
    gap: 10px !important;
  }

  .camera-actionbar .btn {
    min-width: 135px !important;
    padding: 10px 15px !important;
    font-size: .88rem !important;
  }

  .corner.tl, .corner.tr { top: 20px !important; }
  .corner.bl, .corner.br { bottom: 145px !important; }
}

/* Desktop tinggi/lebar: jangan kembali melebar karena override revisi sebelumnya. */
@media (min-width: 1500px) {
  .camera-dialog {
    width: 600px !important;
    max-width: 600px !important;
  }
  .camera-stage {
    height: 590px !important;
  }
}

/* HP tetap portrait dan memanfaatkan hampir seluruh lebar layar. */
@media (max-width: 767.98px) {
  .camera-dialog {
    width: calc(100vw - 14px) !important;
    max-width: none !important;
    margin: 7px auto !important;
  }
}


/* ===== SELFIE PORTRAIT FULL VERTICAL FIT =====
   Seluruh header, kamera, geotag, dan tombol harus muat di viewport.
   ========================================================== */
.camera-modal {
  overflow-y: auto !important;
  padding: 10px 0 !important;
}

@media (min-width: 768px) {
  .camera-dialog {
    width: min(92vw, 620px) !important;
    max-width: 620px !important;
    height: auto !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 0 auto !important;
  }

  .camera-modal-content {
    height: auto !important;
    max-height: calc(100dvh - 20px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .camera-modal-content .modal-header {
    flex: 0 0 auto !important;
    padding: 12px 18px !important;
  }

  .camera-modal-content .modal-header h2,
  .camera-modal-content .modal-title {
    font-size: clamp(1.35rem, 2.2vw, 1.75rem) !important;
    margin-bottom: 2px !important;
  }

  .camera-modal-content .modal-header p {
    font-size: .76rem !important;
    line-height: 1.25 !important;
  }

  .camera-stage {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 4 / 5 !important;
    overflow: hidden !important;
  }

  #cameraVideo,
  #capturedImage {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    object-fit: cover !important;
  }

  .camera-geo-card {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-height: 108px !important;
    grid-template-columns: 145px minmax(0, 1fr) !important;
    padding: 7px !important;
  }

  .camera-map-col,
  .camera-map-frame,
  .camera-map-placeholder {
    height: 92px !important;
    min-height: 92px !important;
  }

  .camera-geo-info h3 { font-size: .68rem !important; }
  .camera-geo-info p,
  .gps-status { font-size: .56rem !important; line-height: 1.16 !important; }

  .corner.tl, .corner.tr { top: 18px !important; }
  .corner.bl, .corner.br { bottom: 125px !important; }

  .camera-actionbar,
  .camera-modal-content .modal-footer {
    position: relative !important;
    flex: 0 0 auto !important;
    min-height: 62px !important;
    padding: 8px 12px !important;
    overflow: visible !important;
  }

  .camera-actionbar .btn {
    min-width: 130px !important;
    min-height: 44px !important;
    padding: 8px 14px !important;
    font-size: .82rem !important;
  }
}

/* Layar desktop/laptop yang tingginya pendek: kompres area kamera,
   bukan memotong tombol bagian bawah. */
@media (min-width: 768px) and (max-height: 850px) {
  .camera-dialog,
  .camera-modal-content {
    max-height: calc(100dvh - 12px) !important;
  }
  .camera-stage {
    aspect-ratio: 1 / 1 !important;
  }
  .camera-geo-card {
    max-height: 98px !important;
  }
  .camera-map-col,
  .camera-map-frame,
  .camera-map-placeholder {
    height: 82px !important;
    min-height: 82px !important;
  }
  .corner.bl, .corner.br { bottom: 114px !important; }
}

/* Mobile: seluruh modal dapat discroll jika tinggi layar sangat kecil. */
@media (max-width: 767.98px) {
  .camera-modal {
    align-items: flex-start !important;
    overflow-y: auto !important;
  }
  .camera-dialog {
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    max-height: none !important;
  }
  .camera-modal-content {
    max-height: none !important;
  }
}


/* ===== DISABLE AMBIL FOTO SAAT MENUNGGU GPS ===== */
#captureBtn:disabled,
#captureBtn.gps-waiting {
  background: #6c757d !important;
  border-color: #6c757d !important;
  color: #e9ecef !important;
  opacity: .78 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}
#captureBtn:disabled:hover {
  background: #6c757d !important;
  border-color: #6c757d !important;
}

/* ===== PDF REPORT SETTINGS ===== */
.pdf-settings-card,.drive-status-card{border:1px solid rgba(125,160,200,.18);border-radius:16px;background:rgba(255,255,255,.035);padding:18px}.drive-status-card{display:flex;align-items:center;justify-content:space-between;gap:18px}.drive-badge{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:10px;font-weight:800}.drive-badge.active{background:#159447;color:#fff}.drive-badge.inactive{background:#e63946;color:#fff}.pdf-section{border:1px solid rgba(125,160,200,.16);border-radius:14px;padding:16px;background:rgba(0,0,0,.06)}@media(max-width:767px){.drive-status-card{align-items:flex-start;flex-direction:column}}


/* ===== FRONTEND PORTRAIT / VERTICAL LAYOUT =====
   Membuat keseluruhan card frontend lebih ramping dan vertikal pada desktop,
   tetap responsif pada tablet/HP.
   ========================================================== */
.frontend-portrait-container{
  max-width:720px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}

.frontend-portrait-container .hero-card,
.frontend-portrait-container .section-card{
  width:100%;
}

.frontend-search-row > .col-md,
.frontend-search-row > .col-md-auto{
  flex:0 0 100% !important;
  width:100% !important;
  max-width:100% !important;
}

.frontend-search-row .search-btn{
  width:100% !important;
}

.frontend-employee-fields > [class*="col-md-"]{
  flex:0 0 100% !important;
  width:100% !important;
  max-width:100% !important;
}

.frontend-photo-choices > [class*="col-"]{
  width:100% !important;
  max-width:100% !important;
}

.frontend-portrait-container .upload-choice{
  width:100%;
}

@media (min-width:1200px){
  .frontend-portrait-container{
    max-width:700px !important;
  }

  .frontend-portrait-container .hero-card{
    padding-left:34px !important;
    padding-right:34px !important;
  }
}

@media (max-width:767.98px){
  .frontend-portrait-container{
    max-width:100% !important;
  }
}
