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

:root {
  --primary: #d32f2f;
  --primary-hover: #b71c1c;
  --primary-light: #fff1f2;
  --accent-gold: #f59e0b;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #ca8a04;
  --warning-bg: #fef9c3;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --bg-app: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', Calibri, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

/* Header - SolusiPrint Dominan Kuning-Emas Gradasi Merah-Hitam */
header.app-header {
  background: radial-gradient(circle at 85% 15%, rgba(254, 240, 138, 0.45) 0%, transparent 55%),
              linear-gradient(115deg, #180509 0%, #7f1d1d 10%, #dc2626 22%, #ea580c 35%, #f59e0b 50%, #facc15 72%, #fde047 100%);
  color: #fff;
  padding: 22px 20px 24px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  position: relative;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.header-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b 0%, #facc15 50%, #fef08a 100%);
}

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

.brand-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.brand-badge {
  background: rgba(0, 0, 0, 0.4);
  color: #fef08a;
  border: 1px solid rgba(254, 240, 138, 0.45);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  backdrop-filter: blur(4px);
}

.profile-card {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.avatar-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  display: none;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.profile-info h3 {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #ffffff;
}

.profile-info p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
}

/* Clock Card */
.clock-section {
  padding: 20px 20px 6px;
  text-align: center;
}

.digital-clock {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.digital-date {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Location Status Pill */
.geo-status-box {
  margin: 14px 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.geo-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.8s infinite;
}

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

.btn-refresh-geo {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
}

/* Buttons Grid */
.actions-section {
  padding: 10px 20px;
}

.section-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.absen-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 105px;
}

.absen-card:active {
  transform: scale(0.97);
}

.absen-card.masuk {
  border-color: #22c55e;
}

.absen-card.pulang {
  border-color: #ef4444;
}

.absen-card.istirahat {
  border-color: #f59e0b;
}

.absen-card.completed {
  background: #f0fdf4;
  border-color: #16a34a;
}

.card-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

.card-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.card-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  margin-top: 4px;
}

.card-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Today Log List */
.history-section {
  padding: 12px 20px 80px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 13px;
}

.history-item .tag {
  font-weight: 700;
  color: var(--primary);
}

.history-item .time {
  font-weight: 700;
  color: var(--text-main);
}

/* Floating Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 16px;
}

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

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

/* Modal Register */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.modal-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.45;
}

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

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  background: #fff;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn-primary:active {
  background: var(--primary-hover);
}

.btn-register-link {
  display: block;
  width: 100%;
  padding: 12px;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  border: 1px dashed #cbd5e1;
  margin-top: 14px;
  transition: background 0.2s;
}

.btn-register-link:hover {
  background: #f1f5f9;
}

.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  margin: 16px 0;
  font-weight: 600;
}

.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.divider-text:not(:empty)::before { margin-right: .5em; }
.divider-text:not(:empty)::after { margin-left: .5em; }

.device-token-badge {
  background: #f1f5f9;
  border: 1px dashed var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 14px;
}

/* Toast */
.toast-box {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  width: 380px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { top: -60px; opacity: 0; }
  to { top: 16px; opacity: 1; }
}

.toast-success { background: #15803d; color: #fff; }
.toast-error { background: #b91c1c; color: #fff; }
.toast-info { background: #0284c7; color: #fff; }

/* Mode Switcher (Absen Harian vs Jurnal vs Cuti) */
.mode-switch-container {
  display: flex;
  gap: 8px;
  padding: 14px 16px 6px;
  background: var(--card-bg);
}

.btn-mode {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.btn-mode .mode-icon {
  font-size: 15px;
  display: inline-block;
  line-height: 1;
}

.btn-mode.active {
  background: #0f172a;
  color: #f59e0b; /* Brand yellow accent */
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
}

.btn-mode:active {
  transform: scale(0.97);
}

/* Jurnal Notice Banner */
.jurnal-notice-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 14px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.jurnal-notice-box.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.jurnal-notice-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jurnal-notice-icon {
  font-size: 20px;
  line-height: 1;
}

.jurnal-notice-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
}

.jurnal-notice-box.done .jurnal-notice-title {
  color: #15803d;
}

.jurnal-notice-desc {
  font-size: 11px;
  color: #b45309;
  margin-top: 2px;
  line-height: 1.3;
}

.jurnal-notice-box.done .jurnal-notice-desc {
  color: #166534;
}

.btn-goto-jurnal {
  padding: 8px 12px;
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-goto-jurnal:hover {
  background: #b45309;
}

.jurnal-notice-box.done .btn-goto-jurnal {
  background: #16a34a;
}

/* Badge Lock pada Absen Pulang */
.badge-lock {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  margin-top: 4px;
  border: 1px solid #fecaca;
}

/* Jurnal Photo Upload Slots */
.photo-slot-card {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.photo-slot-card.has-file {
  background: #f0fdf4;
  border-color: #86efac;
}

.slot-main-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slot-thumb-box {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.slot-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.slot-thumb-box span {
  font-size: 22px;
}

.slot-info {
  flex: 1;
  min-width: 0;
}

.slot-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.slot-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.25;
}

.btn-pick-photo {
  padding: 6px 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-pick-photo:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.photo-slot-card.has-file .btn-pick-photo {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.slot-ket-box {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.slot-ket-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.slot-ket-label .req-badge {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  letter-spacing: 0.2px;
}

.ket-foto-input {
  width: 100%;
  font-size: 12px;
  padding: 8px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
  color: #0f172a;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ket-foto-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Jurnal Preview Grid */
.jurnal-preview-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.jurnal-preview-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  position: relative;
}

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

.jurnal-preview-item .lbl {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 8.5px;
  text-align: center;
  padding: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Form Usulan Cuti */
.form-cuti-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.cuti-summary-card {
  margin-top: 24px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font-size: 14px;
  color: #1e293b;
}

.summary-line {
  margin-bottom: 6px;
  font-size: 14px;
}

.summary-line b {
  color: #d32f2f;
  font-weight: 800;
}

.cuti-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.cuti-table-header {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #475569;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.cuti-table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.cuti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.cuti-table th {
  background: #f1f5f9;
  padding: 10px 14px;
  font-weight: 700;
  color: #334155;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cuti-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.cuti-table tr:last-child td {
  border-bottom: none;
}

.cuti-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-menunggu { background: #fef3c7; color: #b45309; }
.badge-disetujui { background: #dcfce7; color: #15803d; }
.badge-ditolak { background: #fee2e2; color: #b91c1c; }

.cuti-item-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

