/* =============================================================================
   AKSARASA ABSENSI - DESIGN SYSTEM & MOBILE STYLESHEET
   Aesthetic: Aksarasa Studio Terracotta Rust, Warm Linen Canvas & Deep Charcoal
   Matching: Aksarasa Studio Official Visual Identity
   ============================================================================= */

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

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* ---------------------------------------------------------------------------
     AKSARASA STUDIO BRAND COLOR PALETTE (From Reference Image)
     --------------------------------------------------------------------------- */
  /* Warm Linen & Cream Canvas */
  --bg-main: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #FDFBF8;
  --bg-card-hover: #F7F2EA;
  --bg-elevated: #F4ECE1;
  --bg-glass: rgba(250, 247, 242, 0.92);

  /* Warm Studio Borders */
  --border-color: #EBE4D8;
  --border-light: #F2ECE3;
  --border-focus: rgba(200, 90, 50, 0.5);

  /* Primary Brand: Terracotta Rust / Warm Sienna */
  --primary: #C85A32;
  --primary-hover: #B44A24;
  --primary-dark: #963A1B;
  --primary-light: #FDF6F0;
  --primary-border: #F5D5C0;
  --primary-glow: rgba(200, 90, 50, 0.28);

  /* Studio Accents */
  --accent: #DE8F65;
  --accent-light: #FBF2EB;

  /* Semantic Colors */
  --success: #16A34A;
  --success-light: #F0FDF4;
  --success-border: #BBF7D0;
  --success-glow: rgba(22, 163, 74, 0.25);

  --warning: #D97706;
  --warning-light: #FFFBEB;
  --warning-border: #FDE68A;

  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --danger-border: #FECACA;
  --danger-glow: rgba(220, 38, 38, 0.25);

  /* Typography Colors (Rich Deep Charcoal) */
  --text-main: #191817;
  --text-secondary: #484541;
  --text-muted: #78736E;
  --text-subtle: #A8A29E;

  /* Roundedness (Studio Pill Aesthetic) */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  /* Shadows (Warm Floating Studio Elevation) */
  --shadow-sm: 0 2px 8px rgba(25, 24, 23, 0.04);
  --shadow-md: 0 8px 24px rgba(25, 24, 23, 0.06);
  --shadow-lg: 0 16px 40px rgba(25, 24, 23, 0.10);
  --shadow-glow: 0 6px 20px var(--primary-glow);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -----------------------------------------------------------------------------
   BASE RESET & TYPOGRAPHY
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* Aksarasa Target Circle Logo Mark */
.brand-target-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid #191817;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.brand-target-circle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #191817;
}

/* -----------------------------------------------------------------------------
   MOBILE APP CONTAINER (RESPONSIVE WRAPPER)
   ----------------------------------------------------------------------------- */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-main);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(25, 24, 23, 0.08);
  overflow-x: hidden;
}

@media (min-width: 768px) {
  body {
    background: radial-gradient(circle at 50% 15%, #F4EDE2 0%, #FAF7F2 80%);
    padding: 24px 0;
  }

  .app-container {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    min-height: calc(100vh - 48px);
    min-height: calc(100dvh - 48px);
    overflow: hidden;
  }
}

/* -----------------------------------------------------------------------------
   AUTH / LOGIN SCREEN (STUDIO AESTHETIC)
   ----------------------------------------------------------------------------- */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5.5vw, 36px) clamp(16px, 4.5vw, 24px);
  position: relative;
  background: radial-gradient(circle at top right, rgba(200, 90, 50, 0.09) 0%, transparent 65%);
  width: 100%;
  box-sizing: border-box;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  color: var(--primary);
  font-size: clamp(0.72rem, 3.2vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  max-width: 100%;
  box-sizing: border-box;
}

.brand-logo-wrap {
  margin-bottom: 20px;
  width: 100%;
}

.brand-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-name-text {
  font-weight: 800;
  font-size: clamp(1.15rem, 4.5vw, 1.35rem);
  color: #191817;
  letter-spacing: -0.025em;
}

.brand-title {
  font-size: clamp(1.85rem, 8.4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.035em;
  line-height: 1.14;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
}

.brand-title-accent {
  background: linear-gradient(135deg, #C85A32 0%, #B44A24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  width: 100%;
  letter-spacing: -0.04em;
  word-break: break-word;
  overflow-wrap: break-word;
}

.brand-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  font-weight: 500;
  margin-top: 10px;
  line-height: 1.5;
  max-width: 100%;
}

.auth-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 5vw, 28px) clamp(16px, 4.5vw, 24px);
  box-shadow: var(--shadow-md);
  margin-top: 16px;
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 19px;
  height: 19px;
  color: var(--text-subtle);
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 90, 50, 0.15);
}

.password-toggle-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

/* Pill Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

.quick-login-box {
  margin-top: 24px;
  padding: 16px;
  background: #FFFFFF;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.quick-login-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.quick-buttons-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-quick {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-quick:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* -----------------------------------------------------------------------------
   APP HEADER & NAVIGATION
   ----------------------------------------------------------------------------- */
.app-header {
  padding: 16px 22px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #DE8F65 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: #FFFFFF;
  box-shadow: 0 4px 12px var(--primary-glow);
  position: relative;
  overflow: hidden;
  border: 2px solid #FFFFFF;
}

.header-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.header-dept {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--primary);
}

/* -----------------------------------------------------------------------------
   MAIN MOBILE CONTENT VIEWS
   ----------------------------------------------------------------------------- */
.app-content {
  flex: 1;
  padding: 20px 22px;
  padding-bottom: 95px; /* space for bottom nav */
  overflow-y: auto;
}

/* View Sections */
.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-view.active {
  display: block;
}

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

/* -----------------------------------------------------------------------------
   LIVE CLOCK & DATE WIDGET (WARM STUDIO)
   ----------------------------------------------------------------------------- */
.clock-widget {
  text-align: center;
  padding: 16px 20px;
  background: radial-gradient(circle at center, rgba(200, 90, 50, 0.08) 0%, transparent 75%);
  margin-bottom: 20px;
}

.live-time-display {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
}

.live-date-display {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-border);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* -----------------------------------------------------------------------------
   TODAY ATTENDANCE STATUS CARD (STUDIO POLAROID / CLEAN WHITE)
   ----------------------------------------------------------------------------- */
.today-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.today-status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #DE8F65);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Pill Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-subtle {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-shift {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  color: #4F46E5;
  border: 1px solid rgba(99, 102, 241, 0.25);
  white-space: nowrap;
}

.checkin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.check-slot {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.slot-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.slot-time {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-display);
}

/* Polaroid-Style Evidence Thumbnail */
.slot-photo-thumb {
  width: 100%;
  height: 95px;
  border-radius: var(--radius-md);
  margin-top: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 3px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(25, 24, 23, 0.08);
  transition: transform var(--transition-fast);
}

.slot-photo-thumb:hover {
  transform: scale(1.03);
}

.slot-evidence-meta {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.slot-empty-state {
  height: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 8px;
  color: var(--text-subtle);
  font-size: 0.75rem;
  text-align: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.work-duration-bar {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
}

.duration-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.duration-val {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--primary);
}

/* -----------------------------------------------------------------------------
   ATTENDANCE ACTION BUTTONS (ROUNDED PILL)
   ----------------------------------------------------------------------------- */
.action-buttons-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-action {
  padding: 16px 14px;
  border-radius: var(--radius-full);
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-normal);
  color: #FFFFFF;
}

/* Check In: Fresh Studio Green */
.btn-check-in {
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  box-shadow: 0 6px 18px var(--success-glow);
}

.btn-check-in:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--success-glow);
}

/* Check Out: Aksarasa Terracotta Rust */
.btn-check-out {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-check-out:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-action:disabled {
  background: #E5DDD0;
  color: #A8A29E;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-action svg {
  width: 24px;
  height: 24px;
}

/* -----------------------------------------------------------------------------
   SUMMARY STATS MINI CARDS
   ----------------------------------------------------------------------------- */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-mini-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-mini-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

/* -----------------------------------------------------------------------------
   ATTENDANCE HISTORY LIST (RIWAYAT)
   ----------------------------------------------------------------------------- */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.history-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.history-item-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.history-date-col {
  display: flex;
  flex-direction: column;
}

.history-date {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.history-times {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.history-evidence-thumbs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(25, 24, 23, 0.12);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.mini-thumb:hover {
  transform: scale(1.15);
}

/* -----------------------------------------------------------------------------
   BOTTOM NAVIGATION BAR (WARM FROSTED GLASS)
   ----------------------------------------------------------------------------- */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 45;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 6px 18px;
  border-radius: var(--radius-full);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-item:hover {
  color: var(--text-main);
}

/* -----------------------------------------------------------------------------
   CAMERA & EVIDENCE CAPTURE MODAL
   ----------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 24, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.btn-close:hover {
  color: var(--text-main);
}

/* Modal Form Wrapper (Pins Footer to Bottom & Enables Scroll) */
.modal-form-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--primary-border);
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

.modal-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--border-color);
  margin-top: 4px;
}

.form-helper-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Camera & Evidence Stage Box */
.camera-viewport-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #191817;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2.5px solid #E7E0D5;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.camera-viewport-wrap.preview-active {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(200, 90, 50, 0.28);
}

#camera-video, #preview-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

/* Face Alignment Guide */
.camera-overlay-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.face-oval-guide {
  width: 160px;
  height: 195px;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(25, 24, 23, 0.38);
}

.camera-guide-text {
  position: absolute;
  bottom: 12px;
  background: rgba(25, 24, 23, 0.82);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: #FAF7F2;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.camera-flip-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(25, 24, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: var(--transition-fast);
}

.camera-flip-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* Geolocation Info Box */
.geo-tag-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.geo-icon {
  color: var(--primary);
  margin-top: 2px;
}

.geo-details {
  flex: 1;
}

.geo-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.geo-coords {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
  word-break: break-all;
}

.geo-address {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.geo-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 4px;
}

/* Face Verified Notification Alert */
.face-verified-alert {
  background: rgba(46, 125, 50, 0.08);
  border: 1.5px solid rgba(46, 125, 50, 0.28);
  border-radius: var(--radius-md);
  padding: 11px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeInTag 0.25s ease-out;
}

.verified-alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2E7D32;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.35);
}

.verified-alert-content {
  flex: 1;
}

.verified-alert-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1B5E20;
  line-height: 1.2;
}

.verified-alert-sub {
  font-size: 0.74rem;
  color: #386641;
  margin-top: 2px;
  line-height: 1.3;
}

/* Snapshot Preview State (Occupies identical bounds inside .camera-viewport-wrap) */
.snapshot-preview-wrap {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #191817;
  z-index: 4;
}

.snapshot-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.snapshot-verified-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(46, 125, 50, 0.92);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 6;
  pointer-events: none;
  animation: fadeInTag 0.25s ease-out;
}

@keyframes fadeInTag {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal Footer Actions */
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  background: var(--bg-card-subtle);
}

.btn-secondary {
  flex: 1;
  padding: 12px 18px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* -----------------------------------------------------------------------------
   TOAST NOTIFICATIONS (WARM STUDIO LOOK)
   ----------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: toastSlideDown 0.3s ease-out;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

.toast.toast-warning {
  border-left: 4px solid var(--warning);
}

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

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -----------------------------------------------------------------------------
   PREMIUM STUDIO EMPLOYEE ID CARD (HIGH-CONTRAST & CRISP READABILITY)
   ----------------------------------------------------------------------------- */
.employee-id-card {
  background: linear-gradient(135deg, #1C1917 0%, #292421 55%, #3E2419 100%);
  border: 1px solid rgba(200, 90, 50, 0.45);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #FFFFFF;
  box-shadow: 0 14px 34px rgba(25, 24, 23, 0.22), 0 0 24px rgba(200, 90, 50, 0.16);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.employee-id-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(200, 90, 50, 0.4) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

.id-card-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(200, 90, 50, 0.25);
  color: #FDBA74;
  border: 1px solid rgba(200, 90, 50, 0.5);
  margin-bottom: 8px;
}

.id-card-nik-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #F5D5C0;
  backdrop-filter: blur(4px);
}

.id-card-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF !important;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.id-card-dept {
  font-size: 0.85rem;
  color: #E7E5E4 !important;
  font-weight: 500;
}

.id-card-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(200, 90, 50, 0.4) 50%, rgba(255, 255, 255, 0.08) 100%);
  margin: 16px 0;
}

.id-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.id-card-col-full {
  grid-column: span 2;
}

.id-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #A8A29E !important;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.id-card-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: #FFFFFF !important;
  word-break: break-word;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* -----------------------------------------------------------------------------
   GOOGLE reCAPTCHA & ANTI-BOT SECURITY CHALLENGE
   ----------------------------------------------------------------------------- */
.recaptcha-wrapper {
  margin: 14px 0 16px 0;
}

.recaptcha-card {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 76px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.recaptcha-error {
  color: #DC2626;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
  text-align: center;
  animation: fadeIn 0.2s ease-out;
}

/* Smart Native reCAPTCHA Widget */
.smart-recaptcha-box,
.fallback-recaptcha-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 304px;
  background: #FAFAFA;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.recaptcha-left-col,
.fallback-recaptcha-left {
  display: flex;
  align-items: center;
}

.recaptcha-checkbox-label,
.fallback-checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.recaptcha-checkbox-hidden,
.fallback-checkbox-input {
  display: none;
}

.recaptcha-custom-checkbox,
.fallback-custom-checkbox {
  width: 26px;
  height: 26px;
  border: 2px solid #C1C1C1;
  border-radius: 3px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.recaptcha-custom-checkbox:hover,
.fallback-custom-checkbox:hover {
  border-color: #9CA3AF;
}

.recaptcha-spinner-ui,
.fallback-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2.5px solid #2563EB;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.recaptcha-checkmark-svg,
.fallback-checkmark-icon {
  display: none;
  width: 18px;
  height: 18px;
}

.recaptcha-custom-checkbox.verified,
.fallback-custom-checkbox.verified {
  border-color: #16A34A;
  background: #F0FDF4;
}

.recaptcha-custom-checkbox.verified .recaptcha-checkmark-svg,
.fallback-custom-checkbox.verified .fallback-checkmark-icon {
  display: block;
}

.recaptcha-custom-checkbox.loading,
.fallback-custom-checkbox.loading {
  border-color: #2563EB;
}

.recaptcha-custom-checkbox.loading .recaptcha-spinner-ui,
.fallback-custom-checkbox.loading .fallback-spinner {
  display: block;
}

.recaptcha-label-text,
.fallback-label-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1F2937;
}

.recaptcha-right-col,
.fallback-recaptcha-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 12px;
  border-left: 1px solid #E5E7EB;
}

.recaptcha-text-brand,
.recaptcha-brand-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: #6B7280;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.recaptcha-links,
.recaptcha-brand-meta {
  font-size: 0.58rem;
  color: #9CA3AF;
}

.recaptcha-links a,
.recaptcha-brand-meta a {
  color: #6B7280;
  text-decoration: none;
}

.recaptcha-links a:hover,
.recaptcha-brand-meta a:hover {
  text-decoration: underline;
}

/* =============================================================================
   MOBILE RESPONSIVE & ADAPTIVE STYLING (FULL VIEWPORT FIT - NO CUT-OFFS)
   ============================================================================= */
@media (max-width: 480px) {
  /* Prevent horizontal scroll and clipping */
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .app-container {
    max-width: 100vw;
    box-shadow: none;
    border: none;
    border-radius: 0;
  }

  /* Login Screen Adjustments */
  .login-screen {
    padding: 24px 16px;
    justify-content: center;
  }

  .brand-badge {
    padding: 6px 14px;
    font-size: clamp(0.74rem, 3.2vw, 0.8rem);
    margin-bottom: 14px;
    letter-spacing: 0.01em;
  }

  .brand-title {
    font-size: clamp(1.75rem, 8.2vw, 2.25rem);
    letter-spacing: -0.04em;
    line-height: 1.14;
    width: 100%;
  }

  .brand-title-accent {
    display: block;
    width: 100%;
    letter-spacing: -0.045em;
  }

  .brand-subtitle {
    font-size: clamp(0.88rem, 3.6vw, 0.98rem);
    line-height: 1.45;
  }

  .auth-form {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    margin-top: 16px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .form-label {
    font-size: 0.8rem;
    margin-bottom: 5px;
  }

  .form-control {
    font-size: 0.9rem;
    padding: 12px 14px 12px 40px;
    border-radius: var(--radius-md);
  }

  .input-icon {
    left: 13px;
    width: 17px;
    height: 17px;
  }

  /* reCAPTCHA widget fit */
  .recaptcha-card {
    padding: 4px;
  }

  .smart-recaptcha-box,
  .fallback-recaptcha-box {
    padding: 8px 10px;
    max-width: 100%;
  }

  .recaptcha-label-text {
    font-size: 0.8rem;
  }

  /* App Header */
  .app-header {
    padding: 12px 16px;
  }

  .header-name {
    font-size: 0.92rem;
  }

  .header-dept {
    font-size: 0.72rem;
  }

  .user-avatar-wrap {
    width: 38px;
    height: 38px;
    font-size: 0.92rem;
  }

  /* Main Scrollable View */
  .app-content {
    padding: 16px 14px calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* Live Clock */
  .clock-widget {
    padding: 12px 14px;
    margin-bottom: 14px;
  }

  .live-time-display {
    font-size: clamp(1.8rem, 8.5vw, 2.3rem);
  }

  .live-date-display {
    font-size: 0.82rem;
  }

  /* Attendance Card */
  .today-status-card {
    padding: 16px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
  }

  .card-header-title {
    font-size: 0.76rem;
  }

  .checkin-grid {
    gap: 8px;
    margin-bottom: 12px;
  }

  .check-slot {
    padding: 10px 10px 12px;
    border-radius: var(--radius-md);
  }

  .slot-label {
    font-size: 0.68rem;
  }

  .slot-time {
    font-size: 1.15rem;
  }

  .slot-photo-thumb,
  .slot-empty-state {
    height: 76px;
  }

  .work-duration-bar {
    padding: 10px 14px;
  }

  .duration-label {
    font-size: 0.76rem;
  }

  .duration-val {
    font-size: 0.9rem;
  }

  /* Action Buttons */
  .action-buttons-wrap {
    gap: 8px;
    margin-bottom: 18px;
  }

  .btn-action {
    padding: 13px 8px;
    font-size: 0.82rem;
    gap: 6px;
    border-radius: var(--radius-lg);
  }

  .btn-action svg {
    width: 20px;
    height: 20px;
  }

  /* Mini Stats */
  .stats-summary-grid {
    gap: 8px;
    margin-bottom: 18px;
  }

  .stat-mini-card {
    padding: 10px 6px;
    border-radius: var(--radius-md);
  }

  .stat-mini-val {
    font-size: 1.25rem;
  }

  .stat-mini-label {
    font-size: 0.68rem;
  }

  /* History list items */
  .history-item-card {
    padding: 12px 14px;
  }

  .history-date {
    font-size: 0.85rem;
  }

  /* Modals */
  .modal-overlay {
    padding: 10px;
  }

  .modal-content {
    max-width: 100%;
    margin: 0;
    max-height: 94vh;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 14px 16px;
    gap: 12px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  /* Bottom Navigation */
  .bottom-nav {
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .nav-item {
    padding: 4px 10px;
    font-size: 0.7rem;
    gap: 3px;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  /* Profile ID Card */
  .employee-id-card {
    padding: 16px 14px;
    border-radius: var(--radius-lg);
  }

  .id-card-name {
    font-size: 1.15rem;
  }
}

/* Extra Compact Phones (e.g. 320px - 360px devices) */
@media (max-width: 360px) {
  .login-screen {
    padding: 18px 12px;
  }

  .brand-title {
    font-size: clamp(1.5rem, 7.8vw, 1.75rem);
    letter-spacing: -0.045em;
    line-height: 1.15;
    width: 100%;
  }

  .brand-title-accent {
    display: block;
    width: 100%;
    letter-spacing: -0.05em;
  }

  .auth-form {
    padding: 16px 12px;
  }

  .checkin-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .action-buttons-wrap {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .btn-action {
    flex-direction: row;
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .stats-summary-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .stat-mini-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
  }

  .nav-item {
    padding: 4px 6px;
  }
}


