/* ============================================================================
   PORTAL STAFF KWANTUM v2 — MODULES CSS (Login, Camera, Geofence, Pengaturan)
   ============================================================================ */

/* ============================================================================
   LOGIN SCREEN
   ============================================================================ */
.login-stage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  background: var(--canvas-grad);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-grad);
  border: 1px solid var(--rim-light);
  border-radius: 28px;
  box-shadow: var(--shadow-raised);
  overflow: hidden;
}

.login-hero {
  background: var(--indigo-grad);
  color: #FFFFFF;
  padding: 26px 24px 22px 24px;
  text-align: center;
  position: relative;
}

.login-logo-box {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px auto;
  border-radius: 18px;
  background: var(--grad-navy);
  border: 1px solid rgba(189, 213, 245, 0.35);
  box-shadow: 0 8px 20px rgba(10, 19, 36, 0.40);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.login-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #FFFFFF;
}

.login-sub {
  margin: 5px 0 0 0;
  font-size: 12px;
  color: #B4C6DE;
}

.login-body {
  padding: 22px 24px 24px 24px;
}

.pin-input-wrap {
  position: relative;
  margin-top: 8px;
  margin-bottom: 14px;
}

.pin-input-big {
  width: 100%;
  height: 52px;
  text-align: center;
  letter-spacing: 6px;
  font-size: 20px !important;
  font-weight: 800;
  border-radius: 16px;
  background: #EAF1FA;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sunken);
  color: var(--text-main);
  outline: none;
}
.pin-input-big:focus {
  box-shadow: var(--shadow-sunken), 0 0 0 2px rgba(62, 109, 168, 0.35);
}

.login-status-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--card-soft-grad);
  border: 1px solid var(--rim-light);
  box-shadow: var(--shadow-raised-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-sub);
}

.login-alert {
  padding: 10px 12px;
  border-radius: 13px;
  background: #FCE4EC;
  border: 1px solid #F0A3BD;
  color: #962248;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.45;
}

.demo-hint-box {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(62, 109, 168, 0.08);
  border: 1px dashed rgba(62, 109, 168, 0.35);
  font-size: 11.5px;
  color: #2A4B7C;
  line-height: 1.5;
}

/* ============================================================================
   ABSENSI MODAL: LIVE CAMERA VIEWFINDER & GEOFENCE WARNING
   ============================================================================ */
.cam-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 280px;
  border-radius: 18px;
  background: var(--indigo-grad);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 3px 3px 10px rgba(10, 12, 26, 0.65);
  margin: 12px 0;
}

.cam-frame video,
.cam-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cam-overlay-guide {
  position: absolute;
  inset: 14px;
  pointer-events: none;
}

.vf-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(189, 213, 245, 0.72);
  border-style: solid;
}
.vf-tl { top: 0; left: 0; border-width: 2px 0 0 2px; border-radius: 6px 0 0 0; }
.vf-tr { top: 0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 6px 0 0; }
.vf-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; border-radius: 0 0 0 6px; }
.vf-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; border-radius: 0 0 6px 0; }

.cam-placeholder {
  color: #C9DBF2;
  text-align: center;
  padding: 16px;
  font-size: 12px;
  line-height: 1.45;
}

.cam-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.geofence-banner {
  border-radius: 15px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.geofence-banner.ok {
  background: rgba(59, 184, 150, 0.14);
  border-color: rgba(44, 142, 137, 0.35);
  color: #1D615B;
}
.geofence-banner.warn {
  background: rgba(232, 94, 138, 0.13);
  border-color: rgba(202, 63, 108, 0.38);
  color: #8F1F44;
}
.geofence-banner-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.reason-box {
  background: #FDF2F6;
  border: 1px solid #F0B6C9;
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}

.chip-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.reason-chip-btn {
  background: var(--card-grad);
  border: 1px solid var(--rim-light);
  box-shadow: var(--shadow-raised-sm);
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}
.reason-chip-btn:hover {
  background: var(--grad-navy);
  color: #FFFFFF;
}

.char-counter {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  margin-top: 4px;
  color: #8F1F44;
}
.char-counter.valid {
  color: #24665F;
}

.photo-thumb-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #FFFFFF;
  box-shadow: var(--shadow-raised-sm);
  padding: 0;
  cursor: pointer;
  background: #DCE6F3;
}
.photo-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================================
   MENU PENGATURAN (4 SUB-TABS)
   ============================================================================ */
.settings-subtabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.settings-subtabs::-webkit-scrollbar { display: none; }

.subtab-btn {
  flex: 0 0 auto;
  background: var(--card-soft-grad);
  border: 1px solid var(--rim-light);
  border-radius: 14px;
  box-shadow: var(--shadow-raised-sm);
  padding: 10px 15px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.subtab-btn.active {
  background: var(--grad-navy);
  color: #FFFFFF;
  border-color: rgba(189, 213, 245, 0.35);
  box-shadow: 0 6px 15px rgba(42, 75, 124, 0.32);
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.time24-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time24-row .neu-select {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.time24-sep {
  font-weight: 800;
  color: var(--text-sub);
  font-size: 14px;
}
.time24-unit {
  font-size: 11.5px;
  font-weight: 800;
  color: #2A4B7C;
  padding: 0 6px;
  white-space: nowrap;
}

.field-group {
  margin-bottom: 13px;
}
.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}
.field-help {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 4px;
  line-height: 1.35;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--card-soft-grad);
  border: 1px solid var(--rim-light);
  box-shadow: var(--shadow-raised-sm);
  margin-bottom: 10px;
}

.switch-pill {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch-pill input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 99px;
  background: #CEDAE8;
  box-shadow: var(--shadow-sunken-sm);
  transition: 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(15, 27, 48, 0.25);
  transition: 0.2s;
}
.switch-pill input:checked + .switch-slider {
  background: var(--grad-navy);
}
.switch-pill input:checked + .switch-slider::before {
  transform: translateX(22px);
}

.secret-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.secret-input-row .neu-input {
  flex: 1;
}

.loc-card {
  background: var(--card-soft-grad);
  border: 1px solid var(--rim-light);
  border-radius: 18px;
  box-shadow: var(--shadow-raised-sm);
  padding: 15px;
  margin-bottom: 12px;
}
.loc-coords-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* Lightbox Photo */
.lightbox-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 16px;
  background: #0F1B30;
}

/* ============================================================================
   MINIMALIST GLOBAL LOADER
   ============================================================================ */
.global-loader {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(15, 27, 48, 0.24);
  backdrop-filter: blur(2.5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.global-loader.open {
  display: flex;
}
.global-loader-card {
  background: var(--card-soft-grad);
  border: 1px solid var(--rim-light);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(15, 27, 48, 0.22), -5px -5px 14px rgba(255, 255, 255, 0.90);
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  max-width: 300px;
}
.loader-spin-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  animation: kwsSpin 0.8s linear infinite;
}
.global-loader-text {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}
@keyframes kwsSpin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   SPLIT MASUK / PULANG ATTENDANCE TABLE (HEADERLESS ICON COL + ROWSPAN=2)
   ============================================================================ */
.compact-tbl tbody tr.att-pair-odd {
  background: #FAFCFF;
}
.compact-tbl tbody tr.att-pair-even {
  background: #EFF5FC;
}
.compact-tbl tbody tr.is-outside {
  background: linear-gradient(90deg, rgba(232, 94, 138, 0.11) 0%, rgba(253, 245, 248, 0.90) 100%);
  box-shadow: none;
}
.compact-tbl td.att-name-cell {
  vertical-align: middle;
  border-bottom: 1px solid #C8D6E6;
}
.compact-tbl tbody tr.is-outside td.att-name-cell {
  box-shadow: inset 4px 0 0 #D84D79;
}
.compact-tbl tbody tr.att-row-in td:not(.att-name-cell) {
  border-bottom: 1px dashed rgba(176, 195, 219, 0.78);
  padding-top: 9px;
  padding-bottom: 8px;
}
.compact-tbl tbody tr.att-row-out td {
  border-bottom: 1px solid #C8D6E6;
  padding-top: 8px;
  padding-bottom: 9px;
}
.compact-tbl th.att-ico-th,
.compact-tbl td.att-ico-td {
  width: 38px;
  min-width: 38px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.dir-ico {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dir-ico.in {
  background: rgba(59, 184, 150, 0.18);
  color: #1E7A6E;
}
.dir-ico.out {
  background: rgba(238, 163, 81, 0.22);
  color: #B45C1D;
}
.att-lane-muted {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
}

.mcard-lane {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.90);
}
.mcard-lane.lane-in {
  border-left: 3px solid #3BB896;
}
.mcard-lane.lane-out {
  border-left: 3px solid #EEA351;
}
.mcard-lane-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mcard-lane-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
}
.mcard-lane-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.mcard-lane-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

@media screen and (max-width: 900px) {
  .settings-grid-2 {
    grid-template-columns: 1fr;
  }
  .loc-coords-grid {
    grid-template-columns: 1fr;
  }
}
