/* ============ RESET ============ */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============ LAYOUT ============ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  padding: 20px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  opacity: 0.95;
}

.jam {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.main {
  flex: 1;
  padding: 16px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

/* ============ ALERT ============ */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.4;
  animation: slideDown 0.3s ease;
}

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

.alert-info { background: #e3f2fd; color: #0d47a1; border-left: 4px solid #1976d2; }
.alert-success { background: #e8f5e9; color: #1b5e20; border-left: 4px solid #43a047; }
.alert-error { background: #ffebee; color: #b71c1c; border-left: 4px solid #e53935; }

/* ============ FIELD ============ */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.req { color: #e53935; }
.opt { color: #999; font-weight: 400; font-size: 12px; }

.input {
  width: 100%;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus {
  outline: none;
  border-color: #007bff;
  background: #f8fbff;
}

select.input {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

textarea.input {
  resize: vertical;
  min-height: 60px;
}

/* ============ BUTTON ============ */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0,123,255,0.3);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  color: #666;
}

.btn-secondary {
  padding: 14px 20px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:active { background: #e0e0e0; }

.btn-text {
  background: none;
  border: none;
  color: #007bff;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  margin-top: 6px;
}

.btn-text:active { opacity: 0.7; }

/* ============ STATUS CHIPS ============ */
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.status-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: #333;
}

.status-chip:active { transform: scale(0.97); }

.status-chip.active {
  border-color: #007bff;
  background: #e3f2fd;
  color: #0056b3;
  box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

.chip-emoji { font-size: 18px; }

/* ============ FOTO ============ */
.foto-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.foto-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  background: #f8f9fa;
  border: 2px dashed #ccc;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  color: #555;
}

.foto-btn:active {
  background: #e9ecef;
  border-color: #007bff;
}

.foto-preview-wrap {
  margin-top: 12px;
  position: relative;
}

.foto-preview {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 10px;
  background: #f0f0f0;
  display: block;
}

.foto-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foto-info {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  text-align: center;
}

/* ============ GPS ============ */
.gps-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.gps-icon { font-size: 18px; }
.gps-text { flex: 1; }

.gps-loading { background: #fff3e0; color: #e65100; }
.gps-ok { background: #e8f5e9; color: #1b5e20; }
.gps-far { background: #ffebee; color: #b71c1c; }
.gps-off, .gps-error { background: #ffebee; color: #b71c1c; }

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.modal-content h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
}

/* ============ SUKSES ============ */
.modal-sukses {
  text-align: center;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 12px;
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.sukses-detail {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
  font-size: 15px;
  line-height: 1.6;
}

.jam-besar {
  font-size: 24px;
  font-weight: 700;
  color: #007bff;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* ============ FOOTER ============ */
.footer-note {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin-top: 16px;
  padding-bottom: 20px;
}

/* ============ RESPONSIVE ============ */
@media (min-width: 640px) {
  .status-grid { grid-template-columns: repeat(4, 1fr); }
  .foto-btns { grid-template-columns: 1fr 1fr; }
                       }
